Capturing Exceptions while debugging

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

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.

ย 

Solution:

Remember, This solution is for Xcode 4.2.1 for Lion.

1. ย Select View->Navigators->Show Breakpoint Navigator

Screen Shot 2012 02 22 at 4 42 58 PM

2. At the Bottom-left cornet, Click the ‘+’ symbol and Select ‘Add Exception Breakpoint’ Menu

Screen Shot 2012 02 22 at 4 43 20 PM

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

3. In the popped-up window you may select [All | Objective-C | C++ ] options to select what type of Exception should the execution stop.

Screen Shot 2012 02 22 at 4 44 15 PM

ย 

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.

ย 

ย 

4 thoughts on “Capturing Exceptions while debugging

Leave a Reply

Your email address will not be published. Required fields are marked *