如何设置Xcode“调试/发布目标设置"? [英] How to setup Xcodes "debug/release target settings"?

查看:103
本文介绍了如何设置Xcode“调试/发布目标设置"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里找到了一组很棒的宏目标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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆