The best way is to use Xcode configuration files .
Add a couple of files named Beta.xcconfig and Distribution.xccconfig (or something like that) and add your own macros for each type of assembly.
Beta.xcconfig:
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) BETA=1
Distribution.xcconfig.
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) BETA=0
You can easily add files using the new file dialog box:

Then you need to map each file to the build style. Get the top-level project, project parameters (directly above the target objects) and click "Information":

In your code, you can use the macro as usual:
#if BETA // do something only in beta
If, instead of assigning a value, you simply define a macro, you should use #ifdef .
If you use multiple macros, you may need to verify that everything is working properly in your build logs:

source share