One of the hidden gems in Xcode 4.2 is the “Exception Breakpoint” feature. Once you enable it, your debugging life becomes much easier because whenever an exception is thrown in your app, Xcode will bring up the line of code that caused the exception to occur. This is particularly useful if your call stack window is empty (which I have seen happen sometimes while working on iOS apps). Instead of relying on a brief error message in the Output pane, which doesn’t contain much more than the type of exception and its error message, you get to see exactly where the problem is!
You can add an Exception Breakpoint by opening up the Breakpoint Navigator pane, and clicking on the X button in the bottom left corner:
After clicking the “Add Exception Breakpoint…” menu item, you will see this breakpoint configuration view open up:
Click the Done button and you will the new Exception Breakpoint in your list of breakpoints. If you want to have all of your Xcode workspaces include the Exception Breakpoint, right-click (Ctrl + click) on it and open the “Move Breakpoint To” menu item:
After clicking “User” in the submenu, you will see that the Exception Breakpoint is in the User group of breakpoints. Open up another project and it automatically be included in the list of breakpoints.