Re: Comparing results of @encode
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