Hopefully this is a simple question to answer – I think I’m being a n00b here.
I have, for the first time, created an XCode project with two targets. But I now want to add some code to differentiate between my two targets.
#ifdef MyTargetOne
x = 1;
#ifdef MyTargetTwo
x = 2;
I have two targets, but where do I declare “MyTarget1” and “MyTarget2”??
THANKS GUYS!
For each target you need a target-specific define – you can use the
Preprocessor Macrossetting for this ([GCC_PREPROCESSOR_DEFINITIONS, -D]) – addMyTargetOne=1in the first target andMyTargetTwo=1in the second.