How to add Exception Breakpoint in Xcode?

int main(int argc, char *argv[]) {

    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    int retVal = UIApplicationMain(argc, argv, nil, @"AppController");
    [pool release];
    return retVal;
}

My Project randomly crashed in below code, searched in google and some one suggested to add Exception Breakpoint. I added break point by clicking on source line..Editing breakpoint not allow me to change type. How to add Exception Breakpoint and where to add? (in AppDelegate?

enter image description here

1 upvote
  flag
it doesn't crash in given code. – rptwsthi
1 upvote
  flag
@rptwsthi, yup, after adding exception-breakpoint-in-xcode I got exact line of crash. Its great..why not apple by default enable this in debug mode...:) – iPhoneChip
upvote
  flag
@iPhoneChip: Probably because it just stops there and doesn't provide the information about the exception. – Rakesh

3 Answers 11

You can easily add Exception Breakpoint in Xcode. See below image:

enter image description here

Here are the steps.

  • Move to "Breakpoint Navigator".

  • Click + symbol at bottom-left corner of navigator.

enter image description here

  • You should see this.

enter image description here

Follow these steps:

  • On xcode go to Breakpoint navigator (press command+6/ For xcode7+ command+7)
  • click on + button at bottom left
  • Click on add exception break point, follow the instruction in following image

enter image description here

Not the answer you're looking for? Browse other questions tagged or ask your own question.