• 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: NSUInteger question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSUInteger question


  • Subject: Re: NSUInteger question
  • From: Christopher Nebel <email@hidden>
  • Date: Wed, 9 Apr 2008 14:01:33 -0700

On Apr 9, 2008, at 9:30 AM, Corbin Dunn wrote:

On Apr 8, 2008, at 5:30 PM, Timothy Reaves wrote:

What advantage does NSUinteger have over uint32? I realize that on a 64 bit machine, it would be a uint64.

I think everyone is missing the point. The advantage is not "None".

I didn't mean to say that NS[U]Integer has no point, but rather that it doesn't make sense to say that it has an "advantage" (or not) over uint32_t, because they mean different things. If what you want is a machine-sized integer, then NSInteger has some very clear advantages over the alternative (lots of ifdefs). However, if what you want is specifically a 32-bit integer, then NSInteger would just be wrong. I'd venture that most uses are in the former camp, not the latter, but it deserves at least a little thought.


As for the question of "NSInteger" versus "long", I've had to work on enough different architectures that I consider there to be an implicit advantage in a typedef (NSInteger) over a bare "long", but that's me.


--Chris Nebel _______________________________________________

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: 
 >NSUInteger question (From: Timothy Reaves <email@hidden>)
 >Re: NSUInteger question (From: Corbin Dunn <email@hidden>)

  • Prev by Date: Re: CGImage
  • Next by Date: Hide application from dock
  • Previous by thread: Re: NSUInteger question
  • Next by thread: Programmatic binding not working both ways?
  • Index(es):
    • Date
    • Thread