xcode 无法打开文档“MainStoryBoard.storyboard”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12725116/
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
The document "MainStoryBoard.storyboard" could not be opened
提问by Say2Manuj
The document "MainStoryBoard.storyboard" could not be opened. The operation couldn't be completed. (com.apple.InterfaceBuilder error -1.)
无法打开文档“MainStoryBoard.storyboard”。操作无法完成。(com.apple.InterfaceBuilder 错误 -1。)
Our team using SVN and when one of our developer committed the code, the others are get above message and are unable to open the MainStoryBoard. Also we have tried checking out the whole repository, but still the error exists.
我们的团队使用 SVN,当我们的开发人员之一提交代码时,其他人收到上述消息并且无法打开 MainStoryBoard。我们也尝试检查整个存储库,但仍然存在错误。
Any help will be greatly appreciated.
任何帮助将不胜感激。
Thanks.
谢谢。
回答by David Cespedes
Try to make sure all the UILabels in the storyboard are using plain text
尝试确保故事板中的所有 UILabels 都使用纯文本
This solve the problem for me after almost 4 hours of trying everything!!!!
经过近 4 个小时的尝试,这为我解决了问题!!!!
And also make sure you have installed on your system the fonts you are trying to use.
还要确保您已在系统上安装了您尝试使用的字体。
回答by Michael J.
We had this problem today - a remote developer could not open a storyboard that worked fine on two machines here. Xcode 4.5.1 and iOS 6.0.
我们今天遇到了这个问题 - 远程开发人员无法打开在两台机器上正常工作的故事板。Xcode 4.5.1 和 iOS 6.0。
I opened the storyboard file in BBEdit and used the "Zap Gremlins" command. It found several gremlins, all in a few attributed strings (that we were styling as a frill, not at all necessary). I closed BBEdit without saving, went back into Xcode, and removed these strings from the storyboard file. Xcode is now able to open the storyboard.
我在 BBEdit 中打开了故事板文件并使用了“Zap Gremlins”命令。它发现了几个小精灵,都在几个属性字符串中(我们将其样式化为装饰,完全没有必要)。我没有保存就关闭了 BBEdit,回到 Xcode,并从故事板文件中删除了这些字符串。Xcode 现在可以打开故事板。
回答by LordBron
Kunal Balani has the right answer. It wasn't that attributed text was adding bad info into the Storyboard. It was that the other machine didn't have the font files installed.
Kunal Balani 给出了正确的答案。并不是归因文本将错误信息添加到故事板中。那是另一台机器没有安装字体文件。
回答by exeapps
Custom fonts that were used by the attributed label was missing on the target machine. Installing the font solved the issue for me. Thx Kunal
目标计算机上缺少属性标签使用的自定义字体。安装字体为我解决了这个问题。Thx 库纳尔
回答by mcrrnz
I had the same problem when i copied a project from one MAC to another. Finally i discover that i need to install some fonts that were being use in the story board.
当我将一个项目从一个 MAC 复制到另一个时,我遇到了同样的问题。最后我发现我需要安装一些在故事板中使用的字体。
回答by Anbu.Karthik
convert the All UILabels in the storyboard are using plain text
转换故事板中的所有 UILabels 都使用纯文本
回答by LunaCodeGirl
In my case the storyboard file had somehow ended up with execute permissions:
在我的情况下,故事板文件以某种方式结束了执行权限:
-rwxr-xr-x 1 Luna staff 106K Oct 28 00:07 Main.storyboard
-rwxr-xr-x 1 Luna staff 106K Oct 28 00:07 Main.storyboard
Comparing this to other storyboard files in my project it was clear that was abnormal. Running chmod -x Main.storyboard
fixed the problem:
将此与我项目中的其他故事板文件进行比较,很明显这是不正常的。运行chmod -x Main.storyboard
解决了这个问题:
-rw-r--r-- 1 Luna staff 106K Oct 28 00:07 Main.storyboard
-rw-r--r-- 1 Luna staff 106K Oct 28 00:07 Main.storyboard
回答by Shaked Sayag
For me editing the storyboard didn't solve the problem. The only thing that worked was to create a new storyboard file, open the old and the new storyboards as source code (right click -> open as), and copy the xml from the old to the new storyboard. I didn't take the whole xml, just the scope of the <scenes> </scenes>
对我来说,编辑故事板并没有解决问题。唯一有效的是创建一个新的故事板文件,将旧的和新的故事板作为源代码打开(右键单击 -> 打开为),然后将 xml 从旧的故事板复制到新的故事板。我没有拿整个xml,只是范围<scenes> </scenes>