On 23 Feb 2014, at 14:15, Graham Cox <graham....@bigpond.com> wrote:
> On 23 Feb 2014, at 11:08 pm, jonat...@mugginsoft.com wrote:
> 
>>> 1(int) and 1(float) can be represented by the same NSNumber object 
>>> perfectly legally.
>> Is that true?
> 
> I said "can be", not "is". Certainly my observation in the past was that 
> NSNumber stored, as an int, a float that could be represented purely by an 
> int. This was probably in the 10.4/10.5 timeframe or so, which caused me to 
> create a class that stored the original data type as well as a value. It may 
> be that the implementation has changed since then - certainly tagged pointers 
> weren't used - and it's actually always a separate object now where -objCType 
> doesn't ever change. But that just shows that the implementation can change 
> in a way that would affect your scheme, and could again.

 Graham is right. Similarly, in ye olde days, NSNumber numberWithBool: used to 
return NSNumbers containing the int 1 or 0. These days, they’re short-circuited 
to actually return kCFBooleanTrue and kCFBooleanFalse. It has changed, and 
might change again.

Cheers,
-- Uli Kusterer
“The Witnesses of TeachText are everywhere...”
http://zathras.de


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to