I have a project I am splitting into two targets. The original single-target project uses a number of define commands, however I need these values to now be different depending on which target I am building.
What’s the correct way to do that? Should I be using NStrings declared on the AppDelegate? Or can I use a #if statement when settings the #defines?
Any help, much appreciated.
One approach would be like this:
Then add
MON_TARGET_AorMON_TARGET_Bto your target’s preprocessor settings.Usually, you’ll use
GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPSand notGCC_PREPROCESSOR_DEFINITIONSbecause the latter can prevent sharing of PCH headers.To add this, go to:
then drop
GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPSinto the search field and set its value to something like:MON_TARGET_A $(inherited)