如何设置Xcode“调试/发布目标设置"? [英] How to setup Xcodes "debug/release target settings"?
问题描述
我在这里找到了一组很棒的宏目标C宏
I have found a set of great macros here Objective C Macros
我放了:
#if DEBUG==1
#define .... macros
在我的头文件中.
现在,我简直不知道在Xcode中在何处设置 DEBUG = 1 或 DEBUG = 0 它会在调试时定义宏,而不是在发布时定义宏.
Now I simply can't figure out where to set DEBUG=1 or DEBUG=0 in Xcode so that it will define the macro when debugging and not when releasing.
希望有人可以帮助我找到缺少的下拉菜单:)
Hope someone can help me find the missing drop down menu:)
推荐答案
好吧,显然,在使用iPhone应用程序时,您必须:
Ok apparently, when working on an iPhone application, you have to:
- 选择iPhone设备作为活动SDK
- 然后编辑项目或目标设置,并在其他C标志"中键入"-DDEBUG = 1"
编辑项目或目标设置,选择Debug
配置,然后查找预处理器宏"设置并键入DEBUG=1
Edit your project or target settings, select your Debug
configuration then look for the "Preprocessor Macros" settings and type DEBUG=1
但是,我宁愿在Release
配置中定义NDEBUG
然后编写
However, I would rather define NDEBUG
in the Release
configuration then write
#ifndef NDEBUG // if we are in debug mode
#define bla bla bla
#endif
注意:您需要有一个将Objective-C源文件编译为正确设置的库或应用程序的目标;否则设置不会出现在用户界面中.
Note: you need to have a target that compiles Objective-C source files to a library or application properly set up; otherwise the settings don't appear in the UI.
这篇关于如何设置Xcode“调试/发布目标设置"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!