Changes

Using Objective-C Preprocessor Directives

23 bytes added, 20:07, 31 March 2011
m
The #define Statement
== The #define Statement ==
<google>IOSBOX</google>
The #define statement can be used for a variety of purposes and is probably the most flexible of preprocessor directives. Perhaps one of the most common uses is to give frequently used constant values in a program a programmer friendly name and single point of definition. For the sake of an example, let's say you need to frequently use the boiling temperature of water (a point of contention but for the purposes of this example we will assume it to be 99.61 degrees Celsius) throughout your Objective-C program. One option might be to simply enter the constant value wherever it is needed. For example: