I want to define a global preprocessor directive in my app. For example:
In MyProgram.h, I define:
#define USE_LOCALHOST
I import this file from beginning in appDelegate.m.
For the later use, in another file, I refer to this global preprocessor directive.
In MyWebService.h, I define:
#ifdef USE_LOCALHOST
static NSString *MY_SERVER = @"http://192.168.1.130:8888";
#else
static NSString *MY_SERVER = @"http://myserver.com";
#endif
However, the value of MY_SERVER is always @"http://myserver.com". How to make it work properly? Thanks.