Re: NSUInteger question
Re: NSUInteger question
- Subject: Re: NSUInteger question
- From: Christopher Nebel <email@hidden>
- Date: Tue, 8 Apr 2008 18:19:54 -0700
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.
"Advantage"? None, really. It's a question of what you're trying to
express -- do you want specifically a 32-bit unsigned integer, or do
you want an unsigned integer that reflects the architecture's word
size? For instance, there's no particular reason to limit NSArray's
capacity to exactly 2^32 items all the time, so -count is defined as
returning an NSUInteger -- 2^32 in 32-bit, or 2^64 in 64-bit. (Also
consider the analogous size_t type.)
--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