So I am working on a learning project and I am trying to create a header file that contains a store of URL's so that you can just change a single flag to change from Debug to Production. This is what I am trying to do with the compiler and it is clearly wrong. I can't find any information on how to do this in Objective-C, so that's why I came here.
#define DEBUG 1
#if DEBUG
NSString *URL = @"dev.myserver.com";
#else
NSString *URL = @"myserver.com";
#endif
@interface GlobalURLRefrences : NSObject {
//NSString *URL; removed this
}
//@property (nonatomic, retain) NSString *URL; removed this
@end
Now I am not sure if I need to declare that as a property or not. Also, once this is compiled properly, how to I access it from an outside class (of course after you #import
the globalURL's class) Any sort of guidance on the proper method of doing this would be greatly appreciated.