I have an application with several different Targets defined. I know that I can use preprocessor directives to have different sections of code for different targets, but how do the naming conventions work? For instance, if I have two Targets called “Smith” and “Smith Plus” how do these translate?
#if (Smith)
#elif (Smith Plus)
#endif
You basically have it right.
In your project settings, when you click on a target you will see a tab for ‘build settings’. Under there search for preprocessor macros. For your smith target, add a the preprocessor macro “SMITH=1”. Do the same for your smith plus target (SMITH_PLUS=1).
Then, in your code, you just use the like you illustrated yourself: