Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mathcolo

macrumors 6502a
Original poster
Sep 14, 2008
860
16
Boston
Hi everyone, I've got a really annoying and pesky problem! :D

Some array in my application is throwing an NSRangeException, but I have no idea which array it is! This is the error:

Code:
*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSMutableArray objectAtIndex:]: index 8 beyond bounds [0 .. 6]'

Any thoughts on how to figure out exactly which array is causing this? I've tried breakpoints and also many NSLog statements to find where the exception is being thrown, but I haven't been successful. (This is in some code where there are 3-5 nested loops and if statements) Thanks!
 
If you're running your app through the debugger, it should break immediately on the problematic line of code. Go to Run > Debugger.
 
Make sure that Run > Stop on Objective-C Exceptions is checked, and of course run the app in the debugger. You'll find the exact line.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.