I\'m learning iPhone programming from Erica Sadun\'s The iPhone Developer\'s Cookbook. When I run the app I created by following the steps in the Temperature Conversion Exa
Put a breakpoint at objc_exception_throw
and run your app via Debug instead of Run
To clarify, what you're actually seeing when you get an exception without the breakpoint is the same stack trace always - it's the uncaught exception handler. The type of exception is logged to the Run console, but if you want to see a backtrace for where the exception was raised, that's what the breakpoint is for.
As Kevin answered, you will find more helpful debugging info by setting a breakpoint at objc_exception_throw
.
If you are using Xcode 4.2, you can add this symbolic breakpoint by going to Breakpoint Navigator > Click on the add icon on the bottom left > Add symbolic breakpoint > Enter objc_exception_throw
for Symbol > Done.
http://ijoshsmith.com/2011/11/28/debugging-exceptions-in-xcode-4-2/
Same as samewize's solution, but also shows how to make this breakpoint show up by default in all your projects (right click on breakpoint, Move Breakpoint To, User).
In the new Xcode (at least starting from v4.5), you can catch all exceptions easily by doing this:
I think the above is the same as a breakpoint on objc_exception_throw
. http://samwize.com/2012/09/26/xcode-4-dot-5-tips-and-tricks/