I'm trying to figure out how to strip debug logging from my project when I build it for release and found an excellent thread here: Is it true that one should not use NSLog() on production code?
A bit below the answer another user explained how to enable/disable the DEBUG_MODE definition, so I went in exactly as explained, i.e.
In the project settings, "preprocessor macros", debug row it already read "debug=1", so I added the "debug_mode=1" to the end of the string so that it now reads "debug=1 debugmode=1" (with an ${inherited} inbetween, whatever that is...)
However, I now get a compiler yellow warning saying:
Lexical or preprocessor issue, "DEBUG_MODE" macro redefined on the row in my prefix.pch file where I added:
#define DEBUG_MODE
#ifdef DEBUG_MODE
#define DebugLog( s, ... ) NSLog( @"<%p %@:(%d)> %@", self, [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] )
#else
#define DebugLog( s, ... )
#endif
If someone could explain this define issue i'd be grateful.