xcode中项目/目标的单独设置是什么意思? [英] What is the meaning of separate settings for project/target in xcode?

查看:101
本文介绍了xcode中项目/目标的单独设置是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

["旧的问题标题曾经是 ARC设置为YES,但xcode显示NO ,为了使问题更清晰而进行了编辑.]

[ Old question title used to be ARC is set to YES, but xcode shows NO, edited in order to make the question clearer.]

我在xcode 4.2.1中有一个使用iOS 5.0 SDK的iOS项目.该项目受版本控制(使用内置的git接口),早期的提交之一是在将项目转换为使用ARC之后.从那时起,其他所有提交都正常运行

I have an iOS project in xcode 4.2.1 using the iOS 5.0 SDK. The project is under version-control (using the built-in git interface), and one of the early commits was after I converted the project to use ARC. Since then all worked OK with some more commits etc.

现在,我突然注意到xcode中的构建设置表明相关选项("Objective-C自动引用计数")设置为NO.但是当我直接检查项目设置文件project.pbxproj时(通过版本控制或仅通过文本编辑器打开它),我看到CLANG_ENABLE_OBJC_ARC设置为YES.

Now I suddenly notice that the build settings from within xcode shows that the relevant option ("Objective-C Automatic Reference Counting") is set to NO. But when I check the project settings file project.pbxproj directly (either via the version control or just by opening it with a text editor) I see that CLANG_ENABLE_OBJC_ARC is set to YES.

这是我应该担心的问题吗?该项目将编译并运行正常.

Is this a problem I should worry about? The project compiles and runs OK.

编辑

正如Dondragmer所指出的,项目和目标都有一个单独的标志.实际上,对于该项目,它已设置为否",对于目标是.为项目/目标单独设置标志是什么意思?

As Dondragmer pointed out, there is a separate flag for the project and for the target. Indeed for the project it was set to NO and for the target YES. What does it mean to have a separate flag for the project/target?

推荐答案

现在的问题显然是:为项目/目标单独设置标志是什么意思?"

The question is now apparently: "What does it mean to have a separate flag for the project/target?"

这并不重要,除非您在一个项目中有多个目标.如果这样做,则可以在项目级别设置通用设置. (例如,基本的SDK,或者是否打开了ARC,或者您使用的是哪个编译器.)

It isn't important unless you have multiple targets in one project. If you do, you can set common settings at the project level. (For instance, the base SDK, or whether ARC is turned on, or which compiler you're using.)

然后,在您的目标中,仅设置一些需要不同的设置.

Then, in your targets, set only the few settings that need to be different.

这样,当您要更改基本的SDK或更改编译器时,可以在一个位置上进行操作,而不必更改每个目标.这可以使大型项目更易于处理.

This way, when you do want to change the base SDK, or change the compiler, you can do it in exactly one place, rather than changing every target. This can make large projects much easier to deal with.

这篇关于xcode中项目/目标的单独设置是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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