How do I define preprocessor macros in Xcode 4?

后端 未结 2 1878
难免孤独
难免孤独 2020-12-05 04:45

I have two targets set up for my app (a lite version and a pro version) and I want to integrate some subtle differences in the code for each of them (e.g. the pro version wi

相关标签:
2条回答
  • 2020-12-05 05:24

    The build setting you need to change is called 'Preprocessor Macros' and it can be found in the 'Build Settings' tab of the Project Settings pane (use the search box to find it). Select each target in turn in the left-hand side of the Project Settings pane then modify the Preprocessor Macros setting.

    The setting is specified as a space-separated list of preprocessor macros in the form 'foo' or 'foo=bar'.

    0 讨论(0)
  • 2020-12-05 05:24

    I'm not on my mac at the moment, so I can't give full step-by-step directions, but I believe this should be accurate, if not as detailed as I would otherwise be. Create a new build target. Go to the configuration screen for this new target. There should be a tab along the lines of compilation options. In this tab there should be a row for other compiler flags. In there, put -DPRO_VERSION.

    0 讨论(0)
提交回复
热议问题