Xcode 3.2.5:将“将警告视为错误”设置为和“运行静态分析器”对于新项目来说都是如此
问题
每次我在 Xcode 中创建一个新项目时,我都必须转到 Project >编辑项目设置并导航到将警告视为错误并运行静态分析器将其打开。在我的一生中,我似乎无法找到从现在开始如何将其设置为默认值。
我尝试过的
通过菜单进行搜索。谷歌。 Stackoverflow.com。午夜在墓地进行动物献祭(好吧,我还没有尝试过,但在这之后它是我清单上的下一个)。
问题
是否有一种简单的方法来为新项目设置编译器设置?
请不要告诉我升级到 Xcode 4。我已经有了它(并且还没有探索是否可以在其中完成此任务)。我仍然需要 Xcode 3 几个月。
哎呀!差点忘了——提前致谢!
The Problem
Every time I create a new project in Xcode I have to go to Project > Edit Project Settings and navigate to Treat Warnings as Errors and Run Static Analyzer to turn them on. For the life of me I cannot seem to find out how to make this the default from now on.
What I Have Tried
Hunting through the menus. Google. Stackoverflow.com. A animal sacrifice in a graveyard at midnight (OK, I haven't tried that yet, but after this it is next on my list).
The Question
Is there a simple way of setting compiler settings for new projects?
Please don't tell me to upgrade to Xcode 4. I already have it (and have not explored to see if I can accomplish this task in it yet). I still will need Xcode 3 for a few months.
Whoops! Almost forgot -- thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最简单的方法是简单地创建一个启用这些设置的自定义项目模板。创建两个新项目,更改其中一个项目的设置 - 然后对两个项目的 project.pbxproj 文件进行比较,以查看项目文件中的设置如何发生。
然后在以下位置找到现有的项目模板:
/Developer/Library/Xcode/Project Templates
将它们复制到本地库中的本地自定义项目模板目录中:
~/Library/Application Support/Developer/ Shared/Xcode/Project Templates
(不要忘记空格)
然后修改项目模板中的项目文件,使其具有与之前从项目 diff 中获得的相同更改。
The easiest way would be to simply create a custom project template that had those settings enabled. Create two new projects, change the settings in one - then do a diff on the project.pbxproj files for both to see how the settings occur in the project file.
Then find the existing project templates in:
/Developer/Library/Xcode/Project Templates
Copy them into the local custom project template directory in your local Library:
~/Library/Application Support/Developer/Shared/Xcode/Project Templates
(don't forget the space)
Then modify the project file in the project template to have the same changes you got out of the project diff before.