Search code examples
xcodedebuggingtestingbreakpointsocunit

How to make Xcode to stop at exception on test code?


When I testing my code with OCUnit, it makes exception log and makes it fail, but never stop when the exception raises. Even the breakpoint doesn't work.

I want to track the stack and see the state at the time of exception, but debugger doesn't pop up. How can I debug test code like regular code?


Solution

  • Set an exception breakpoint on the project. Go to the Breakpoint tab on the left pane of XCode. It looks like an arrow pointing Right. Then at the bottom of that screen click the + and Add Exception Breakpoint...