• 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: Comparing results of @encode
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Comparing results of @encode


  • Subject: Re: Comparing results of @encode
  • From: Graham Cox <email@hidden>
  • Date: Mon, 27 Oct 2008 19:04:52 +1100


On 27 Oct 2008, at 3:47 pm, Michael Ash wrote:

As far as I know the conversion happens upon request, not upon
storage. In other words, the internal representation is of the type
you initially used to create the NSNumber. If you then request the
value through a method whose type doesn't match, it retrieves the
internal representation, converts it to the requested type, then
returns that. The internal storage remains the original type, so you
can still distinguish between how they were created.


If true, I can rest easy! But there is this remark:

"Note, though, that if you ask a number for its objCType, the returned type does not necessarily match the method the receiver was created with."

found here:

http://developer.apple.com/documentation/Cocoa/Conceptual/NumbersandValues/Articles/Numbers.html

which appears to suggest that there are cases where conversion happens at creation time and that the information about the original type is lost. Unfortunately the docs aren't more explicit. :(


cheers, Graham _______________________________________________

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: 
 >Comparing results of @encode (From: Graham Cox <email@hidden>)
 >Re: Comparing results of @encode (From: "Michael Ash" <email@hidden>)
 >Re: Comparing results of @encode (From: Graham Cox <email@hidden>)
 >Re: Comparing results of @encode (From: "Michael Ash" <email@hidden>)

  • Prev by Date: Re: Security - Write to protected directory
  • Next by Date: Re: Finding out that a volume is going away before it does
  • Previous by thread: Re: Comparing results of @encode
  • Next by thread: Re: Just starting off in obj C
  • Index(es):
    • Date
    • Thread