-
Book Overview & Buying
-
Table Of Contents
Mac Application Development by Example: Beginner's Guide
By :
We can make a small change to the SimpleCalc program to demonstrate an integer division by zero that results in the Debug area appearing while the program is running.
Create a new Xcode project (we can follow the steps given in Chapter 1, Our First Program – SimpleCalc) but call it BuggyCalc instead of SimpleCalc. Other than the App name being BuggyCalc, all the steps are the same as was done for SimpleCalc.
The complete project for BuggyCalc is included in the downloadable content for this book so if you don't want to create BuggyCalc yourself, you can just download the project and open it in Xcode.
In BuggyCalc, select the filename BTSAppDelegate.m and add the following line of code that uses the compiler directive #define to create a symbol named D_SHOW_DIVIDEBYZERO_BUG with a value of 1:
#define D_SHOW_DIVIDEBYZERO_BUG 1
If you are using the pre-built project, locate the line of code that defines the symbol and change its value from 0 to...
Change the font size
Change margin width
Change background colour