• 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: NSCFArray -- What the heck?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSCFArray -- What the heck?


  • Subject: Re: NSCFArray -- What the heck?
  • From: Michael Becker <email@hidden>
  • Date: Mon, 19 Jan 2004 18:00:24 +0100

Well, arrays start at zero and go up to their bound minus 1. So this array here has three elements: 0, 1, and 2. Your program tried to access element 3, which is beyond the bounds of the array.

This isn't specific to NSCFArrays, but is standard throughout all arrays in all languages (at least mainstream languages).



Thanks, sorry. I actually knew that, but somehow I figured that Cocoa would (in order to point out the problem) print out the index of the last item instead of the actual array-count. It felt a little strange to read that "(3) is beyond (3)" :-)

My fault!

Bye,
Michael
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >NSCFArray -- What the heck? (From: Michael Becker <email@hidden>)

  • Prev by Date: Re: how to capture data on USB port
  • Next by Date: [OT]Internal SCSI HD partitions and Panther...
  • Previous by thread: Re: NSCFArray -- What the heck?
  • Next by thread: Panther broke CFUserNotificationDisplayNotice?
  • Index(es):
    • Date
    • Thread