• 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: Getting true 32-bit integers with NSNumber?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Getting true 32-bit integers with NSNumber?
      • From: Alex Hall <email@hidden>
References: 
 >Getting true 32-bit integers with NSNumber? (From: Alex Hall <email@hidden>)
 >Re: Getting true 32-bit integers with NSNumber? (From: Kyle Sluder <email@hidden>)
 >Re: Getting true 32-bit integers with NSNumber? (From: ChanMaxthon <email@hidden>)
 >Re: Getting true 32-bit integers with NSNumber? (From: Kyle Sluder <email@hidden>)
 >Re: Getting true 32-bit integers with NSNumber? (From: ChanMaxthon <email@hidden>)

  • Prev by Date: Re: Fast hash of NSData?
  • Next by Date: Re: Fast hash of NSData?
  • Previous by thread: Re: Getting true 32-bit integers with NSNumber?
  • Next by thread: Re: Getting true 32-bit integers with NSNumber?
  • Index(es):
    • Date
    • Thread