保存-构建-运行后 Xcode 项目代码更改未 100% 更新
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2567278/
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 Project Code Changes Not Updating 100% After Save-Build-Run
提问by Greg
When I make code changes to my iPhone game project in Xcode, and then do CMD-B + Enter, I expect the project to be saved, build and run on the simulator with the latest. What is happening though, sometimes, is that it doesn't pick up a small change I make unless I clean the project and then build.
当我在 Xcode 中对我的 iPhone 游戏项目进行代码更改,然后执行 CMD-B + Enter 时,我希望该项目能够使用最新版本在模拟器上保存、构建和运行。但是,有时发生的情况是,除非我清理项目然后构建,否则它不会接受我所做的一个小的更改。
I'm a long time Java person and newish to C-based languages and it's compiler. Can someone explain to me what is cached after each build that does this and how to change my project settings to avoid having to clean every time? Or tell me the bad news that this is part of C development? Not trying to bash it - I get compiled JSPs stuck in the working cache often in Java, too. :P
我是 Java 的老手,对基于 C 的语言及其编译器不熟悉。有人可以向我解释每次构建后缓存的内容以及如何更改我的项目设置以避免每次都需要清理吗?或者告诉我这是 C 开发的一部分的坏消息?不试图打击它 - 我也经常在 Java 中将编译的 JSP 卡在工作缓存中。:P
UPDATE: Does this have to do with the location of my builds at all? That's the only thing I can think of that's changed from a build config perspective.
更新:这与我的构建的位置有关吗?从构建配置的角度来看,这是我能想到的唯一改变。
回答by Nath
Had a similar problem, I reset content and settings in the iPhone simulator
遇到了类似的问题,我在 iPhone 模拟器中重置了内容和设置
回答by Nick Moore
Seems odd to me, because I never get this problem in XCode. It's not a common issue with C or anything. The tools for C-based languages usually do this just as well as the Java ones.
对我来说似乎很奇怪,因为我从未在 XCode 中遇到过这个问题。这不是 C 或任何东西的常见问题。用于基于 C 的语言的工具通常与 Java 的工具一样好。
回答by karthik89
Go to Product Menu and choose Clean and then choose Build. Thats it.
转到产品菜单并选择清洁,然后选择构建。就是这样。
回答by TechZen
In the Xcode Build Preferences make sure that "Unsaved Files" is set to "Always Save". If not, Xcode will not autosave files before building and will use the last version saved to disk.
在 Xcode Build Preferences 中确保“Unsaved Files”设置为“Always Save”。如果没有,Xcode 将不会在构建前自动保存文件,而是使用保存到磁盘的最后一个版本。
回答by Yarmoshy
In case anyone still comes across this (as I was having this issue today on Xcode 5.1), all I had to do was open a new tab and close out the tab I was working in. Some sort of tab bug in Xcode.
如果有人仍然遇到这个问题(因为我今天在 Xcode 5.1 上遇到了这个问题),我所要做的就是打开一个新选项卡并关闭我正在使用的选项卡。 Xcode 中的某种选项卡错误。
回答by Naval Hasan
I am not sure about this, But in case if you are using git, go to xcode preferences -> Source control -> General
我对此不确定,但如果您使用的是 git,请转到 xcode 首选项 -> 源代码控制 -> 常规
- Uncheck Refresh local status automatically
- Uncheck Fetch and refresh server status automatically
- Uncheck Add and remove files automatically
- Uncheck Select files to commit automatically
- 取消选中自动刷新本地状态
- 取消选中自动获取和刷新服务器状态
- 取消选中自动添加和删除文件
- 取消选中选择要自动提交的文件