Wheres my stack trace gone? Wheres my stack trace gone? xcode xcode

Wheres my stack trace gone?


The problem is that the debugger isn't stopping when the exception occurs, it is stopping when the program crashes. This happens after the the exception unwinds the stack, which means the source is no longer there. If you want the debugger to stop before the stack is unwound, you need to set a breakpoint when the exception is thrown. Xcode makes this easy. Go to the breakpoints section in the project window.

enter image description here

Then, click the + button in the bottom-left corner and choose "Add Exception Breakpoint…". Make sure that the new breakpoint is set to trigger on throw, or it will still occur after the stack is unwound.

enter image description here