将预处理器宏添加到 xcode 6 中的目标

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26928622/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 18:02:11  来源:igfitidea点击:

Add preprocessor macro to a target in xcode 6

xcodemacrospreprocessortarget

提问by user1051307

Probably this is pretty simple, but I can't find a way to define a preprocessor macro for a target in Xcode 6.

可能这很简单,但我找不到在 Xcode 6 中为目标定义预处理器宏的方法。

回答by JoeFryer

I've done a screenshot to show where it is in Xcode, because it's easier :)

我做了一个截图来显示它在 Xcode 中的位置,因为它更容易:)

enter image description here

在此处输入图片说明

  1. Select project file
  2. Select the target you want
  3. Go to Build Settings
  4. Search for 'preprocessor'
  5. Add your preprocessor macro either for Debug, Release, or both.
  1. 选择项目文件
  2. 选择你想要的目标
  3. 转到构建设置
  4. 搜索“预处理器”
  5. 添加用于调试、发布或两者的预处理器宏。

回答by Irina

In Xcode 9 you have to add a preprocessor macros to Project, not Target. Also don't forget to add "D" as the firs letter. For example, "DDebug", then it works.

在 Xcode 9 中,您必须将预处理器宏添加到 Project,而不是 Target。也不要忘记添加“D”作为第一个字母。例如,“DDebug”,那么它就起作用了。