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.

 

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

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.

 

 

  1. Interesting, this is going to save me some time henceforth.

  2. Great post and great blog.
    Keep up the great work!
    I subscribed your blog.

  3. NS Exception and NSAssert | jamesdevnote - pingback on August 16, 2012 at 7:53 pm

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Trackbacks and Pingbacks: