What is an Exception Breakpoint

- by

Sometimes Xcode just throws an error message that isn’t very helpful. That’s usually when we have to try and figure out why something didn’t go the way we expected it. Other times however, Xcode tells us very clearly which element it isn’t happy with – we fix it and our app progresses. Why can’t it always be that way?

Well that’s because at those unhelpful times, Xcode is technically picking up an “exception”, but it tries to continue to run the programme. That’s when we end up with an error message which isn’t related to the actual problem.

An Exception Breakpoint can help. It’s something we can set and therefore force Xcode to stop when the problem occurs, not several lines later. Here’s how we do it:

  • with the Navigator pane open, select the 6th tab from the left (the Breakpoint Navigator)
  • at the bottom left, click the plus sign to add a breakpoint
  • from the context menu select Add Exception Breakpoint
  • leave all default values and hit Done

Next time Xcode will not try to be heroic and keep going. Instead, expect a more helpful error message.

Screen Shot 2013-03-16 at 23.03.17

Also check out: https://developer.apple.com/library/ios/#recipes/xcode_help-breakpoint_navigator/articles/adding_an_exception_breakpoint.html



If you enjoy my content, please consider supporting me on Ko-fi. In return you can browse this whole site without any pesky ads! More details here.

Leave a Comment!

This site uses Akismet to reduce spam. Learn how your comment data is processed.