I’ve been happily using a replacement for NSLog called DLog so that I don’t have to worry about debugging being left in a release build.
#ifndef NDEBUG
# define DLog(FORMAT, ...) printf("%s\n",
[[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
#else
# define DLog(...)
#endif
However, I’d like to do some a bit more complicated, I have numerous targets with debug parameters and I’d like to include two parameters to enable me to get debugging information.
I had hoped I could use, something like this…
#ifndef NDEBUG
# define DLog(FORMAT, ...) printf("%s\n", ...
#else
#ifdef TESTFLIGHT && FREEMIUM
# define DLog(FORMAT, ...) printf("%s\n", ...
#else
# define DLog(...)
#endif
But it’s not as simple as that.. I’m probably missing something obvious?
I’ve googled the problem but can’t find the AND operator for this purpose and nested IF statements seems a problem too ?
You should use “#elif” to make an else if, instead of nested ifs.
And you can can use the #if defined(TESTFLIGHT) && defined(FREEMIUM), as said on the other answers. So :