I have a project, using the current version of Xcode and llvm.
I am doing a free and paid version of a game, so I have set up a preprocessor flag to do it.
For the paid version target I define PAID_VERSION = 1 (in the “User-Defined” section of Build Settings)
When I compile however the PAID_VERSION keeps coming up with undefined.
So my #ifndef and #ifdef directives build the free version of the app.
I have looked around Stack Overflow and Google and found no hints as to what is going on here.
In the Other C Flags section add
-DPAID_VERSION=1This will define
PAID_VERSIONas1, equivalent to#define PAID_VERSION 1in code.