Re: Help debugging array indexing problem
Re: Help debugging array indexing problem
- Subject: Re: Help debugging array indexing problem
- From: Lorenzo Thurman <email@hidden>
- Date: Fri, 11 Feb 2011 19:30:55 -0600
On Feb 11, 2011, at 1:51 PM, Ken Thomases <email@hidden> wrote:
> On Feb 11, 2011, at 1:27 PM, email@hidden wrote:
>
>> I'm getting this error when clicking between two tables in my application:
>> -[NSCFArray objectAtIndex:]: index (0) beyond bounds (0)
>>
>> I've checked my arrays and they are not the problem. I've added NSAsserts to check my array indeces. It appears to be coming from the frameworks. I set breakpoints at both -[NSException raise] and frpintf (found these tips in the archives), but these are never hit. Specifically, when if I click back and forth between the tables, at some point the error appears. It occurs randomly. I can click in the left table and then the right table without seeing the error, but if I continue to alternate clicks, at some point I'll get the error. How can I debug this without having to set a breakpoint on [NSCFArray objectAtIndex:]? Its called way too much. To be clear, no exception is raised. I would expect an NSRangeException, but I see nothing but the above error.
>
> Try a breakpoint on objc_exception_throw instead of -[NSException raise]. Not all exceptions go through the latter.
>
> You can also put a breakpoint on NSLog and friends (or asl_log and friends) if your app is otherwise quiet in terms of console output.
>
> Cheers,
> Ken
Thanks, objc_exception_throw found the error. I have to apologize, it is my code. Excuse me while I wipe the egg off my face.
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden