Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS how to debug crashes without a stack trace like : [__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array?

I'm trying to dismiss a modal view controller and am getting the following error:

* Terminating app due to uncaught exception 'NSRangeException', reason: '* -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array'

At one point I spent 4 hours trying to debug such error. Can anyone tell me if there's a way to look at stack traces for such errors to understand which object caused the incorrect access?

Thank you!

like image 231
Alex Stone Avatar asked Dec 19 '11 23:12

Alex Stone


1 Answers

if you are running in the debugger, then absolutely you should be able to see the actual line that the exception is being thrown on.

add an exception breakpoint by clicking the breakpoints tab at the top of the left pane, then click the plus sign at the lower left. Add an exception breakpoint.

enter image description here

like image 157
Grady Player Avatar answered Oct 30 '22 14:10

Grady Player