Possible duplicate:
Do I need to disable NSLog before releasing the application?
I wonder if anyone can help me set up several NSLog statements so that they print to the console when executed in "debug mode" but not print in "release mode". I understand that I need to add something like DEBUG = 1 to the debug configuration in Xcode, but I cannot find where. Also how can I use this in my code?
NSLog(@"Print Always"); if(DEBUG) NSLog(@"Print only in debug");
Is there an easy way to do this?
EDIT_001: I tried using this , but now the keys are now displayed only in the "All Settings" section and are beautiful names. I have to use GCC_PREPROCESSOR_DEFINITIONS, so I needed to find "Preprocessor Macros", select the edit and add DEBUG=1 
When you start using it, it's just a case of adding (see below) or some kind of brand to remove the messy # ifdef / # endif tags.
NSLog(@"You always see me?"); #ifdef DEBUG NSLog(@"Only in DEBUG"); #endif
source share