Interface Builder无法打开文档".xib",因为它不存在

MrS*_*eko 22 iphone xcode localization xib

我正在按照此处列出的步骤本地化应用程序.我用大约45个.xib成功实现了这一点,而其中只有4个给了我这个错误:

"Interface Builder无法打开文档".xib",因为它不存在."

当我把它们从原来的位置移开时.我尝试将它们从Project/Classes/Example.xib位置移动到Project/en.lproj/Example.xib上的本地化位置.

为什么不能移动这个.xib文件?

小智 43

对我来说,它的工作原理如下:

  • 选择项目目标
  • 从中的build phases选项卡中删除该文件copy bundle resources
  • 将其添加到build phases选项卡

  • 我爱你.谢谢. (2认同)

jbi*_*sen 12

我在两个不同目录中的.xib文件上运行ibtools时遇到了同样的错误.它在第一个目录中的文件工作正常,但在第二个目录中的文件失败.如果我交换处理目录的顺序,它仍然失败了第二个目录.

最后我发现ibtool启动了一个恶魔进程ibtoold,当ibtool完成时它不会终止,如果我杀了那个进程,我就不会再出错了.显然,恶魔有一些阻碍ibtool在另一个目录中工作的状态.

我曾经pkill ibtoold杀死恶魔.

  • `killall -9 ibtoold`对我来说效果更好.结帐有用[脚本](https://github.com/ole/Storyboard-Strings-Extraction)和[文章](http://oleb.net/blog/2013/02/automating-strings-extraction-from-storyboards - 用于定位/). (3认同)

n8t*_*8tr 5

我在使用Xcode 5时遇到问题可能是同一个问题.在向/从xib文件生成或写入本地化字符串时,ibtools随机工作.我不得不在一些xib文件上使用sudo来使它工作.这是一个例子:

$ibtool --generate-strings-file en.lproj/MyVC.strings en.lproj/MyVC.xib
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"     
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.ibtool.errors</key>
<array>
    <dict>
        <key>description</key>
        <string>Interface Builder could not open the document "MyVC.xib" because it does not exist.</string>
    </dict>
</array>
</dict>
</plist>
Run Code Online (Sandbox Code Playgroud)

使用sudo工作虽然它抱怨'用户域将是不稳定的'

$sudo ibtool --generate-strings-file en.lproj/MyVC.strings en.lproj/MyVC.xib
2013-10-01 10:04:35.943 Interface Builder Cocoa Touch Tool[1717:303] CFPreferences: user       
home directory at file:///var/root/Library/Application%20Support/iPhone%20Simulator/User/ is unavailable. User domains will be volatile.
$
Run Code Online (Sandbox Code Playgroud)