I have some code like this:
#define FORCE_DEBUG_MODE [[[NSUserDefaults standardUserDefaults] valueForKey:@"forceDebugMode"] isEqualToString:@"1"]
#if defined DEBUG_MODE || defined FORCE_DEBUG_MODE
#define DLog( s, ... ) NSLog( @"<%p %@:(%d)> %@", self, [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] )
#else
#define DLog( s, ... )
#endif
I read from some article outside to use the preprocess marcos to define the DEBUG_MODE, however I would like to override the mode if I set a NSUserDefaults value to something.
These code got no errors. But seems that no matter what the FORCE_DEBUG_MODE is, defined FORCE_DEBUG_MODE equal to true. What I want is something like FORCE_DEBUG_MODE == 1
Please tell me if I can do this, and How?