Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add Exception Breakpoint in Xcode?

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

like image 419
iPhoneChip Avatar asked Jul 23 '13 06:07

iPhoneChip


People also ask

How do you add a breakpoint in Xcode?

Navigate to a line in your code where you want execution to pause, then click the gutter or line number in the source editor to set a breakpoint. Xcode displays a breakpoint icon to indicate the location. Drag a breakpoint up or down to move it to another location; drag it away from the gutter to remove it.

What is exception breakpoint in Xcode?

An exception breakpoint is a type of breakpoint that is created when some exception occurs in the code. On occurrence of such exception our application stops at that given condition causing the exception and we can access all variables in scope at that breakpoint.

What is swift error breakpoint?

Swift version: 5.6. Xcode has a few special breakpoint types, accessed by going to the breakpoint navigator (Cmd+8) then clicking + in the bottom-left corner. One of the options in that menu is Swift Error Breakpoint, and it allows Xcode to pause when Swift errors are thrown.

How do you add breakpoints?

To set a breakpoint in source code, click in the far left margin next to a line of code. You can also select the line and press F9, select Debug > Toggle Breakpoint, or right-click and select Breakpoint > Insert breakpoint. The breakpoint appears as a red dot in the left margin.


2 Answers

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

enter image description here

like image 114
Guru Avatar answered Oct 07 '22 02:10

Guru


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

like image 25
βhargavḯ Avatar answered Oct 07 '22 02:10

βhargavḯ