Re: passing nothing to method with CGPoint argument

2009-12-06 Thread Graham Cox
On 06/12/2009, at 1:08 PM, Chunk 1978 wrote: > for factoring purposes i want to be able to call the same > method from touchesEnded that will clear the output strings if there > is no point, but CGPointZero is a point. Can't you just define an 'impossible' point value to act as a sentinel? So

Re: passing nothing to method with CGPoint argument

2009-12-05 Thread Frederik Slijkerman
The usual solution is to change the method signature to accept a CGPoint* argument instead, so you can also pass NULL / nil separately from any point. Best regards, Frederik Slijkerman Chunk 1978 wrote: i have an method that takes a CGPoint as an argument. i would like to call the method wi

Re: passing nothing to method with CGPoint argument

2009-12-05 Thread Chunk 1978
the method that takes the CGPoint argument is called from touchesBegan and touchesMoved. the CGPoint method outputs touch coordinates and the touches only register if the touch is within the frame of the image. for factoring purposes i want to be able to call the same method from touchesEnded tha

Re: passing nothing to method with CGPoint argument

2009-12-05 Thread Dave DeLong
Anything you pass can be interpreted as a point. You could pass an NSString, but those are still pointers, and you can interpret a pointer as a regular number. You could pass a character, but characters are also numbers. In fact, everything in C can be interpreted as a number (this is often v

Re: passing nothing to method with CGPoint argument

2009-12-05 Thread Graham Cox
On 06/12/2009, at 12:59 PM, Chunk 1978 wrote: > i have an method that takes a CGPoint as an argument. i would like to > call the method without supplying a CGPoint, but i can't pass nil or > null. i can pass CGPointZero, but that is still a point: {0, 0} Why would you want to do this? It just

passing nothing to method with CGPoint argument

2009-12-05 Thread Chunk 1978
i have an method that takes a CGPoint as an argument. i would like to call the method without supplying a CGPoint, but i can't pass nil or null. i can pass CGPointZero, but that is still a point: {0, 0} ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple