Debugging applications from crashes with iOS Simulator and Xcode 4 stops in the main () function, and not in the event of a crash

Possible duplicate:
Xcode 4.2 shows the wrong line of code on error

The Xcode 4 debugger does not seem to stop execution anywhere next to the causes of crashes in iOS Simulator. Let's say I injected an error into my code, perhaps such an error is out of bounds:

NSMutableArray * test = [[NSMutableArray alloc] initWithCapacity:5]; [test insertObject:@"Hello" atIndex:10]; 

When the application inevitably crashes, I ended up in the main function in main.m , not having anything in the call stack (view "Downstream") to help me find what went wrong.

Is there a debugging option that is missing from the assembly properties, perhaps? This is Xcode 4.2 on Snow Leopard if that helps.

thanks

+5
objective-c xcode ios-simulator
source share
2 answers

Go to the breakpoints panel and add the bottom left, click the + sign and add “Exception Breakpoint”.

Exceptions: All | Break: On throw.

This should solve the problem in most cases.

+10
source share

Adding an exception checkpoint to Breakpoint Navigator on this issue the accepted answer - Debugging Xcode 4.2 does not symbolize a stack call - fixes the problem.

0
source share

All Articles