开发者

Conditions based upon selected target

开发者 https://www.devze.com 2023-01-16 01:22 出处:网络
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 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消