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 Macros
setting for this ([GCC_PREPROCESSOR_DEFINITIONS, -D]
) - add MyTargetOne=1
in the first target and MyTargetTwo=1
in the second.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With