Conditions based upon selected target
I have a multi-app project which is determined by the Target. Is it possible to have a conditional statement to determine which target is开发者_开发技巧 selected.
I.e I have 2 variations of a similar controller but want to display the relevant one depending on the target
Im hoping for something like the #if/#endif
In your target's xcconfig file, assign a preprocessor macro to test against with #if
:
GCC_PREPROCESSOR_DEFINITIONS = TARGET_MYAPP
If you're using the build pane, this is the "Preprocessor Macros" entry on the target's build pane. You should then switch to xcconfig files. The Growl source code is a good example of a complex multi-target project using xcconfig.
精彩评论