Conditional Compilation and Objective-C/Xcode

后端 未结 3 1251
栀梦
栀梦 2021-01-03 14:52

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

3条回答
  •  长情又很酷
    2021-01-03 15:31

    I think this should work

    #define DEBUG 1
    #if DEBUG
       #define URL = @"dev.myserver.com";
    #else
       #define URL = @"myserver.com";
    #endif
    

提交回复
热议问题