The debugging suggestions made so far in this thread are fine. But really, the only debugging tool needed here is your mind. Developing that tool is the quickest route to fixing bugs like this.

11.06.09 04:24:30 test[767] *** -[NSCFArray objectAtIndex:]: index (0) beyond bounds (0) 11.06.09 04:24:30 test[767] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSCFArray objectAtIndex:]: index (0) beyond bounds (0)'

This is a huge hint as to what the trouble is. You may not see it at the moment, but in time you will - if you learn how to think it through. Right now, you're not really thinking about it (no offense intended), you're just trying stuff, hoping something "fixes" it, and when that doesn't work, posting requests for help without including enough detail for anyone to help you. The trouble is not the bug in your code (everyone creates bugs, and this one is easy) it's the bug in your thinking about the bug.


So how can I find the array call that leads to this?


Cmd-Shift-F, type "objectAtIndex", make sure the search options popup is set to "In Project," hit Return. In the resulting list, look at each found occurrence of "objectAtIndex". Option-click on "objectAtIndex" to bring up its docs. Re-read them. Re-read your code. See see where you might be using objectAtIndex incorrectly.

If you don't see the problem with your usage of objectAtIndex, post the code here so others can see it.


You've said your app is "pretty simple." Any occurrences of objectAtIndex: were likely put there by you. Look at each one and examine how you use it. Re-read the documentation for objectAtIndex and consider if anything you do might be out of accord with the docs you read.

If by chance you don't find any occurrences of objectAtIndex, look at all your other usage of NSArray/CFArray and think about what might happen if any of them happened to invoke objectAtIndex with the values you pass. Could your values trigger any problems?

Failing that, look at every line you've written. Your program is small and simple. Work out what will happen on each line as the program runs.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to