Is there any particular flag which can be set to not display NSLog output in either debug or release?
Thanks.
In Xcode, you can define macros for particular build configurations. For example, here I have DEBUG
defined for Debug builds, and nothing for release builds.
Then to use this in the code, wrap your NSLog(...)
statements in (or however you choose to use the macro, update:darren's method is quite good with this technique):
#ifdef DEBUG
NSLog(...);
#endif
Use the same mechanism for release configuration only logic.
You can use this ability if you have various number of build configurations, and you can define more than one macro if you want to enable/disable different levels of functionality for different build configurations.