We can add a breakpoint to the BuggyCalc App to cause Xcode to identify the exact line of program code that is causing the index out of range error.
In BuggyCalc, select the filename
BTSAppDelegate.m
and make sure the value ofD_SHOW_DIVIDEBYZERO_BUG
is0
and the value ofD_SHOW_INDEXOUTOFRANGE_BUG
is1
.In the Xcode navigator pane, click on the icon to Show the Breakpoint navigator as shown in the following screenshot:
In the Xcode navigator pane, click on the + icon and select the menu item titled Add ExceptionBreakpoint… as shown in the following screenshot:
In the Xcode navigator pane, on the breakpoint options window, select Done to accept the default settings for the exception breakpoint as shown in the following screenshot:
Click on the ÷ button.