Just another iPhone Blog
Capturing Exceptions while debugging
This one is a simple but could be time-saving :)
Scenario: If you are debugging and caught with awkward situation where the application crashes with an exception, like NSInvalidArgumentException and so on, but never take you to the place in the code where the problem exists.
Remember, This solution is for Xcode 4.2.1 for Lion.
1. Select View->Navigators->Show Breakpoint Navigator
2. At the Bottom-left cornet, Click the ‘+’ symbol and Select ‘Add Exception Breakpoint’ Menu
3. In the popped-up window you may select [All | Objective-C | C++ ] options to select what type of Exception should the execution stop.
4. Click Done.
Restart your debug process and you should see the line of code that is causing the hassle for you :)
Courtesy: Apple Developer Document.