How to add Exception Breakpoint in Xcode?

iOSMobile DevelopmentiPhone/iPad

Sometimes while writing an iOS application or any other application we need to test multiple cases and debug the application of any known and unknown bugs. There are certain places in the code where we want our app to stop so that we can know the values of certain variables at the point and fix that bug. Before we learn how to add a break point, first let’s see

What’s a break point?

A break point is a place in our code where the app pauses on a certain event. A break point may be added manually in xcode or may be added programmatically on some event. At the time of writing this article, there are 6 types of Xcode in xcode and Exception break point is one of them.

What is an Exception breakpoint?

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.

How to add an Exception Breakpoint?

Step 1 − To add an exception breakpoint, first move to breakpoint navigator in xcode.

Step 2 − Click on the + option at the left bottom of the navigator and select Exception breakpoint.

Once you select exception breakpoint, it will be added to our code.

Out of all the options you can select an option most suitable for the conditions.

Published on 28-Dec-2018 10:03:52