iPhone Development

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.

 

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.

 

 

About these ads

4 responses to “Capturing Exceptions while debugging

  1. BK April 18, 2012 at 10:58 am

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

  2. lwxted July 7, 2012 at 2:05 am

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

    • bharath2020 July 7, 2012 at 6:19 am

      thank you :)

  3. Pingback: NS Exception and NSAssert | jamesdevnote

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 28 other followers

%d bloggers like this: