Re: Why does NSArray count return NSUInteger?
Re: Why does NSArray count return NSUInteger?
- Subject: Re: Why does NSArray count return NSUInteger?
- From: Siegfried <email@hidden>
- Date: Sun, 29 May 2011 17:13:05 -0300
On 29/05/2011, at 17:04, julius wrote:
> …
> The reason is that [zAry count] returns a result of type NSUInteger!!!!
Exactly.
> …
> Why might the Cocoa developers have chosen to do this?
> …
Not exactly Cocoa developers. In C, considering "uint" an unsigned int variable set to -1, a statement like "uint > 0" returns true.
When one of the literals is unsigned, the other is implicitly converted, and -1 is the highest int possible.
_______________________________________________
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