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: Jens Alfke <email@hidden>
- Date: Mon, 02 Dec 2013 08:54:02 -0800
On Dec 2, 2013, at 2:31 AM, ChanMaxthon <email@hidden> wrote:
> I am just making an example and a point - check what (u)int32_t or (u)int64_t is typedef'd to and return that type.
The OP wants a real-world solution, not an abstract theoretical example of the worst-case way to handle it.
If you want a 32-bit int, call -intValue. If you’re ultra paranoid about int changing to 64-bit in the future and you don’t want to have to fix a warning in that code later on, cast the result to int32_t.
—Jens
_______________________________________________
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