• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: passing nothing to method with CGPoint argument
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: passing nothing to method with CGPoint argument


  • Subject: Re: passing nothing to method with CGPoint argument
  • From: Dave DeLong <email@hidden>
  • Date: Sat, 05 Dec 2009 19:05:20 -0700

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 viewed as one of the limitations of C-based and similar languages).  The only real way around this is to pass a special point that you test for.

An example of this is when you ask NSString for a range of a substring.  It returns an NSRange, and the location is always a valid number.  However, we look for a special value, NSNotFound (which is just a really really big number) to indicate that the string wasn't present.

So you could pass a point that's basically {INFINITY, INFINITY} (or something like that).

But the real question here is "what are you trying to do?".

Cheers,

Dave

On Dec 5, 2009, at 6: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}

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >passing nothing to method with CGPoint argument (From: Chunk 1978 <email@hidden>)

  • Prev by Date: Re: passing nothing to method with CGPoint argument
  • Next by Date: Re: passing nothing to method with CGPoint argument
  • Previous by thread: Re: passing nothing to method with CGPoint argument
  • Next by thread: Re: passing nothing to method with CGPoint argument
  • Index(es):
    • Date
    • Thread