Re: Getting true 32-bit integers with NSNumber?
Re: Getting true 32-bit integers with NSNumber?
- Subject: Re: Getting true 32-bit integers with NSNumber?
- From: Kyle Sluder <email@hidden>
- Date: Mon, 02 Dec 2013 02:25:57 -0800
> On Dec 1, 2013, at 11:10 PM, Alex Hall <email@hidden> wrote:
>
> NSUInteger sourceID = [[(NSDictionary*)sourceNumber objectForKey:@"sourceID"] unsignedIntegerValue];
Again, -unsignedIntValue will return a 32-bit value (int); -unsignedIntegerValue will give you an NSUInteger, which will be 64 bits on 64-bit targets.
The method used to construct the NSNumber is irrelevant. The only thing that matters is how you ask for it back. You're asking for a 64-bit value here.
--Kyle Sluder
_______________________________________________
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