Re: index out of bounds
Re: index out of bounds
- Subject: Re: index out of bounds
- From: Daniel Jalkut <email@hidden>
- Date: Thu, 6 Jul 2006 13:22:34 -0400
I make a habit of avoiding these types of exceptions by always
checking the index against the array count. Something like:
myObject = nil;
if (index < [myArray count])
{
myObject = [myArray objectAtIndex:index];
}
Daniel
On Jul 5, 2006, at 1:32 AM, Rex Fernando wrote:
Hello,
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?
Thanks
Rex
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
sweater.com
This email sent to email@hidden
_______________________________________________
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