• 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: NSInteger vs int vs int32_t
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSInteger vs int vs int32_t


  • Subject: Re: NSInteger vs int vs int32_t
  • From: Fritz Anderson <email@hidden>
  • Date: Mon, 02 Jul 2012 10:56:23 -0500

On 2 Jul 2012, at 6:24 AM, Andreas Grosam wrote:

> Anyway, is it preferable to use always Cocoa macros (NSInteger, NSUInteger, etc.) for an Objective-C API - or may/should I use int, unsigned int, or maybe int32_t, uint32_t, etc. when it seems more appropriate?

It depends on whether it's important to you that the integer be strictly 32 bits wide. NS(U)Integer is 32 bits on iOS and 32-bit Mac, 64 bits on 64-bit Mac.

If your concern is a better impedance match with Cocoa, use NS(U)Integer.

If you have a reason to want a specific width, use (u)int32_t.

	— F


_______________________________________________

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


References: 
 >NSInteger vs int vs int32_t (From: Andreas Grosam <email@hidden>)

  • Prev by Date: Equation style display
  • Next by Date: Re: NSInteger vs int vs int32_t
  • Previous by thread: Re: NSInteger vs int vs int32_t
  • Next by thread: Re: NSInteger vs int vs int32_t
  • Index(es):
    • Date
    • Thread