Interface Builder 无法打开文档“.xib”因为它不存在
我正在按照此处列出的步骤本地化一个应用程序。我已经成功地通过大约 45 个 .xib 实现了这一目标,而其中只有 4 个 .xib 给了我这个错误:
“Interface Builder 无法打开文档“.xib”,因为它不存在。”
当我将它们从原来的位置移开时。我尝试将它们从 Project/Classes/Example.xib 位置移动到 Project/en.lproj/Example.xib 上的本地化位置。
为什么这个 .xib 文件无法移动?
I am localizing an app, following the steps listed here. I have successfully achieved that with around 45 .xib's, while just 4 of them gives me this error:
"Interface Builder could not open the document ".xib" because it does not exist."
when I move them from their original position. I try to move them from their Project/Classes/Example.xib position to the localized one on Project/en.lproj/Example.xib.
Why can't this .xib files be moved?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
对我来说,它的工作原理如下:
复制捆绑资源
中的构建阶段
选项卡中删除文件,构建阶段
选项卡For me it works like this:
build phases
tab incopy bundle resources
build phases
tab在两个不同目录中的 .xib 文件上运行 ibtools 时,我遇到了同样的错误。它对第一个目录中的文件运行良好,但对第二个目录中的文件失败。如果我交换处理目录的顺序,第二个目录仍然失败。
最后我发现 ibtool 启动了一个恶魔进程 ibtoold,当 ibtool 完成时它不会终止,如果我终止了该进程,我就不再收到错误。显然,该恶魔有某种状态阻碍 ibtool 在另一个目录中工作。
我使用
pkill ibtoold
来杀死恶魔。I experienced the same error when running ibtools on .xib files in two different directories. It worked fine with the files in the first directory, but failed on the files in the second directory. If I swapped the order of processing the directories it still failed for the second directory.
Finally I discovered that ibtool starts a demon process ibtoold that doesn't terminate when ibtool finishes, and if I killed that process I no longer got the error. Apparently the demon has some state that hinders ibtool in working in another directory.
I used
pkill ibtoold
to kill the demon.我在使用 Xcode 5 时遇到问题,可能是同样的问题。 ibtools 在生成本地化字符串或从 xib 文件写入本地化字符串时随机工作。我必须对一些 xib 文件使用 sudo 才能使其正常工作。
这是一个例子:
使用 sudo 可以工作,尽管它抱怨“用户域将不稳定”
I am having a problem using Xcode 5 that might be the same issue. ibtools is randomly working when generating or writing localized strings to/from xib files. I had to use sudo on some xib files to get it to work.
Here's an example:
Using sudo works although it complains about 'user domains will be volatile'
对我来说,这发生在 Git 合并之后。项目文件一定已经发生了很大的变化,现在它给出了所有这些错误。那些敏感的项目文件...
所以无论如何,我最终所做的只是从项目中删除文件(将它们发送到垃圾箱),然后使用 git checkout other_branch path/to/ 将它们重新添加到项目中file
此后,构建项目不再抛出此错误。
中删除所有红色文件构建阶段
- 目标设置的编译源
。 XCode 认为这些文件仍然存在,并且认为它仍然应该尝试编译,但是当它找不到它们时,它会返回此错误。To me this happened after a Git merge. The project file must have changed so much that now it gives all these errors. Those sensitive project files...
So anyway, what I ended up doing is just removing the files from the project (sending them to Trash) and then re-adding them to the project with a
git checkout other_branch path/to/file
After this, building the project did not throw this error anymore.
Build Phases
-Compile Sources
of your target's settings. Those are files that XCode thinks are still there and thinks it should still try to compile, but when it doesn't find them, it gives back this error.