Tom

18th March 2012

Stack traces in Xcode 4.1+

Guides | Tutorial By 2 years ago

Since Xcode 4.1 when your application throws an exception your console just prints a list of function pointers and you don’t get a proper stack trace. This isn’t helpful if you’re trying to find the exact line the error occurred on.

2012-03-18 00:01:17.028 Testing[16575:f803] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[testAppDelegate crash]: unrecognized selector sent to instance 0x6d13ae0'
*** First throw call stack:
(0x13c7022 0x1558cd6 0x13c8cbd 0x132ded0 0x132dcb2 0x20b3 0xf386 0x10274 0x1f183 0x1fc38 0x13634 0x12b1ef5 0x139b195 0x12ffff2 0x12fe8da 0x12fdd84 0x12fdc9b 0xfc65 0x11626 0x1da2 0x1d15)
terminate called throwing an exception

There’s a really easy way to solve this, but it’s not very obvious. In your breakpoint navigator (push Command + 6) click the little + down the bottom left hand side. Add an exception breakpoint and you’re done. The next time an exception is thrown, the breakpoint will stop on the problem line, and you get a proper stack trace in your debug navigator.

  • TutLeGrand

    thank you ! it saves my life !! :-)

  • http://www.xiel.de/ Felix

    made my day :) thx

Recommended Posts

Separating Xcode builds (debug vs release)

Post by 2 years ago

When you send a build to your client or testers, it can be difficult telling development builds from AppStore builds. At b2cloud we split the builds with two different app ids, and a different app...

Got an idea?

We help entrepreneurs, organizations and established brands from around
the country bring ideas to life. We would love to hear from you!