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?
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.
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.
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.
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.
You can easily add Exception Breakpoint in Xcode. See below image:
Here are the steps.
Move to "Breakpoint Navigator".
Click + symbol at bottom-left corner of navigator.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With