• 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: index out of bounds
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: index out of bounds


  • Subject: Re: index out of bounds
  • From: Julio Cesar Silva dos Santos <email@hidden>
  • Date: Wed, 5 Jul 2006 09:15:40 -0300

If you are deleting all the objects via code, you must delete from end to beginning otherwise you will receive the 'index out of bounds' message, because if you check the count of objects before deleting this number will decrease at every deletion.

Julio Cesar Silva dos Santos
email@hidden
Blogjective-C
http://www.jcs.santos.nom.br/wp
FetchYourLyrics
http://www.jcs.santos.nom.br/fyl/fyl.html


On 05/07/2006, at 02:49, Chris Suter wrote:

I have a table with data in it. When someone clicks the remove button, I get the selection array and remove all the objects in it. If there is an empty selection, I am told index out of bounds, naturally, because there are no items in the array. Can I just leave this error? Or should I make a catch for it?

No, you shouldn't, you have a bug in your code. Exceptions are generally for exceptional circumstances like running out of memory, not for something that could often happen.


How are you removing all the items? Send some code.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >index out of bounds (From: Rex Fernando <email@hidden>)
 >Re: index out of bounds (From: Chris Suter <email@hidden>)

  • Prev by Date: Re: Permissions in an app bundle
  • Next by Date: Re: Permissions in an app bundle
  • Previous by thread: Re: index out of bounds
  • Next by thread: Re: index out of bounds
  • Index(es):
    • Date
    • Thread