How to define a preprocessor symbol in Xcode

前端 未结 8 1836
旧巷少年郎
旧巷少年郎 2020-11-27 10:32

Is it possible to set a symbol for conditional compilation by setting up properties in an Xcode project?

My aim is to to create a symbol that is available to all fil

相关标签:
8条回答
  • 2020-11-27 11:21

    As an addendum, if you are using this technique to define strings in your target, this is how I had to define and use them:

    In Build Settings -> Preprocessor Macros, and yes backslashes are critical in the definition:

    APPURL_NSString=\@\"www.foobar.org\"
    

    And in the source code:

    objectManager.client.baseURL = APPURL_NSString;
    
    0 讨论(0)
  • 2020-11-27 11:21

    You can duplicate the target which has the preprocessing section, rename it to any name you want, and then change your Preprocessor macro value.

    0 讨论(0)
提交回复
热议问题