如何在 Xcode 4 中使用 .xcconfig 文件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6208224/
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
How can I use .xcconfig files in Xcode 4?
提问by Luke
I just switched over to Xcode 4 and I'm having trouble working with .xcconfig files for build settings. My targets that already had files assigned in Xcode 3 are all set up - a column titled Config.file shows up in the Levels view of Build Settings. But I can't figure out how to edit the columns in this view or where to put an .xcconfig file to attach it to a new target. I've looked online and haven't found an answer. Anybody know how to do this?
我刚刚切换到 Xcode 4,但在使用 .xcconfig 文件进行构建设置时遇到了问题。我已经在 Xcode 3 中分配了文件的目标都已设置 - 标题为 Config.file 的列显示在 Build Settings 的 Levels 视图中。但我不知道如何编辑此视图中的列或将 .xcconfig 文件放在何处以将其附加到新目标。我在网上查过,没有找到答案。有人知道怎么做吗?
回答by Mike Kale
Pick File | New, choose Other and "Configuration Settings File", this gets you a new .xcconfig file.
选择文件 | 新建,选择其他和“配置设置文件”,这将为您提供一个新的 .xcconfig 文件。
Then click on the project on the upper left in the file browser (the same place where you get to build settings), click on the project again in the second-to-left panel, and click on the Info tab at the top of the inner panel.
然后单击文件浏览器左上角的项目(与构建设置相同的位置),再次单击左第二个面板中的项目,然后单击顶部的信息选项卡内面板。
There, you can choose "Based on Configuration File" for each of your targets for each of your configurations (debug, release, etc.)
在那里,您可以为每个配置(调试、发布等)的每个目标选择“基于配置文件”。
Hope this helps!
希望这可以帮助!
回答by allprog
Great answer from Mike Kale. If the description was not clear enough, here is a screenshot.
迈克·凯尔 (Mike Kale) 的精彩回答。如果描述不够清楚,这里是截图。