Preprocessor Directives to separate targets in xcode

后端 未结 1 1205
星月不相逢
星月不相逢 2021-01-17 03:11

I have 2 targets on my project one production and one stage with different configurations. I want in the code to be able to say

#if target == production
NSL         


        
相关标签:
1条回答
  • 2021-01-17 03:48

    You can define some Preprocessor Macros for each Target, like this... ...

    And then you can do something like this:

    #ifdef PRODUCTION
       //some Code
    #elif STAGE
       //some other Code
    #else
       //more Code^^
    #endif
    

    But be carefull if you need it in Debug- and/or in Release-Build, you have to declare it there.

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