Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

davbeck

macrumors regular
Original poster
May 16, 2008
104
0
Reno, NV
Is there any way to get access to the active build configuration in my code? I would like to add in some debugging statements if the configuration is debug like so:

#ifdef DEBUG
//log something
#endif
 
In XCode, go to your project settings. Under the build tab, look for Preprocessor Macros. Set a variable (no need for an =x if you just want to use #ifdef) there for your debug build configuration, and do not define it for your release setting. Then you can use #ifdef and put in the name of the variable you defined to put in your debugging statements.

-Lee
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.