tags:

views:

17

answers:

1

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

A: 

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.

Rob Napier