Friday, March 9, 2012

Missing stack trace in Xcode 4.2+ on iOS Device and Simulator when exception is thrown

After updating Xcode to version 4.2 I had difficulties with iOS app debugging.
For example, when I call objectAtIndex: method of an empty NSArray object, my app receives SIGABRT signal and execution is stopped in main() function with no information that can help me to find the error:

NSRangeException will be thrown

In console we can see that our app has terminated due to uncaught exception NSRangeException.
So the problem is that Xcode doesn't setup exception handler.