• 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: NSNotFound signed???
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSNotFound signed???


  • Subject: Re: NSNotFound signed???
  • From: Quincey Morris <email@hidden>
  • Date: Wed, 12 Jun 2013 09:57:35 -0700

On Jun 12, 2013, at 01:14 , Oleg Krupnov <email@hidden> wrote:

> What if I have sparse array etc.
>
> One higher bit is actually twice as many elements. Why having
> NSUInteger at all if you can't use more than NSIntegerMax? This
> doesn't seem right.

-- If you're talking about NSArray, there's no such thing as a sparse array. That's why NSNotFound == NSIntegerMax works  -- it's a value you can *never* use as a NSArray index, *not* an artificial limitation on the range of indexes.

-- The same is true for (non-sparse) C arrays.

-- If you implement a sparse array yourself, and you want to use the full index range, then you likely wouldn't use NSNotFound as a marker at all. If you need a marker, you'd likely use 0 or NSUIntegerMax, right?

_______________________________________________

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: 
 >NSNotFound signed??? (From: Oleg Krupnov <email@hidden>)
 >Re: NSNotFound signed??? (From: Quincey Morris <email@hidden>)
 >Re: NSNotFound signed??? (From: Quincey Morris <email@hidden>)
 >Re: NSNotFound signed??? (From: Oleg Krupnov <email@hidden>)

  • Prev by Date: Re: NSNotFound signed???
  • Next by Date: Cocoaheads Lake Forest meets this Wednesday, 6/12, at 7pm
  • Previous by thread: Re: NSNotFound signed???
  • Next by thread: Cocoaheads Lake Forest meets this Wednesday, 6/12, at 7pm
  • Index(es):
    • Date
    • Thread