• 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: Why does NSArray count return NSUInteger?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why does NSArray count return NSUInteger?


  • Subject: Re: Why does NSArray count return NSUInteger?
  • From: "email@hidden" <email@hidden>
  • Date: Mon, 30 May 2011 12:20:16 +0100

On 30 May 2011, at 12:03, julius wrote:

>
>
> So was it really just because the number of array elements is never -3 that the Cocoa developers decided to make NSArray count return type NSUInteger?
>
> Julius
>
You always need to pay close close attention to function/method return types, however we all get tripped up on such things from time to time.
In this case, in addition to the illogicality of a negative index, the usage of NSUInteger as opposed to NSInteger doubles the available index range.

Regards

Jonathan Mitchell

Developer
Mugginsoft LLP
http://www.mugginsoft.com_______________________________________________

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: 
 >Re: Why does NSArray count return NSUInteger? (From: julius <email@hidden>)

  • Prev by Date: Re: Why does NSArray count return NSUInteger?
  • Next by Date: Re: Why does NSArray count return NSUInteger?
  • Previous by thread: Re: Why does NSArray count return NSUInteger?
  • Next by thread: Re: Why does NSArray count return NSUInteger?
  • Index(es):
    • Date
    • Thread