What is the meaning of separate settings for project/target in xcode?

…衆ロ難τιáo~ 提交于 2019-12-13 01:45:10

问题


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

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.

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.

EDIT

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?


回答1:


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

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.

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.



来源:https://stackoverflow.com/questions/10058486/what-is-the-meaning-of-separate-settings-for-project-target-in-xcode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!