Xcode:如何更改我的项目文件夹名称,而不会出现构建问题?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7313779/
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
Xcode: How do I change my project folders name, without having building problems?
提问by Niklas Jensen
I would like to change the folder name where my Xcode project is in. But when I do that I can't build my project anymore. It shows me 2 errors that says:
我想更改我的 Xcode 项目所在的文件夹名称。但是当我这样做时,我无法再构建我的项目。它向我显示了 2 个错误:
Apple LLVM compiler 3.0 error file "project name-Prefix.pch" has been modified since the precompiled header was built
Apple LLVM 编译器 3.0 错误文件“项目名称-Prefix.pch”已被修改,因为预编译头被构建
Any way to solve this?
有什么办法可以解决这个问题?
回答by Ashley
Select Product > Clean
from the Xcode menu.
选择Product > Clean
从Xcode的菜单。
Then try and build again by selecting Product > Build
.
然后通过选择 再次尝试构建Product > Build
。
Your project should build without errors assuming that targets are correct.
假设目标正确,您的项目应该没有错误地构建。
回答by Aimi
Either you have replaced the code to some another machine. Try to commit the explicitly included import in the .PCH file. Compile it once on that specific machine. Now un-comment the those import lines and then compile the code again.
要么您已将代码替换为另一台机器。尝试在 .PCH 文件中提交明确包含的导入。在该特定机器上编译一次。现在取消注释那些导入行,然后再次编译代码。
回答by Hiren
If you are trying to build project from terminal then
如果您尝试从终端构建项目,则
execute "$ xcodebuild clean " before execute the build command.
在执行构建命令之前执行“$ xcodebuild clean”。
This will resolve the issue.
这将解决问题。