xcode 界面生成器无法确定故事板的类型
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26517473/
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
Interface Builder unable to determine type of storyboard
提问by Brent
Gone through all the links on google and on here and a lot didn't have answers to them. I have an app that has a MainStoryboard.storyboard and a MainStoryboard_iPad.storyboard. The iPad storyboard opens fine. The "MainStoryboard.storyboard" throws the following error when I click on it in Xcode: "Interface Builder was unable to determine the type of "MainStoryboard.storyboard"." I cannot view or change the storyboard and it prevents the app from building. The build error is "The operation couldn't be completed. (com.apple.InterfaceBuilder error 2001.)"
浏览了谷歌和这里的所有链接,很多都没有答案。我有一个包含 MainStoryboard.storyboard 和 MainStoryboard_iPad.storyboard 的应用程序。iPad 故事板打开正常。当我在 Xcode 中单击“MainStoryboard.storyboard”时,它会引发以下错误:“Interface Builder 无法确定“MainStoryboard.storyboard”的类型。我无法查看或更改故事板,它会阻止应用程序构建。构建错误是“无法完成操作。(com.apple.InterfaceBuilder 错误 2001。)”
So here's what has happened on my end that I'm aware of in the past week. I was on Mavericks and the app built and ran just fine. I am in the middle of a move so I have not touched anything is 6 days. Today I installed Yosemite and upgraded Xcode to 6.1. I launched Xcode selected my storyboard, and these errors occurred.
所以这是我在过去一周所知道的发生在我身上的事情。我在小牛队,应用程序构建并运行得很好。我正在搬家,所以我没有碰任何东西是 6 天。今天我安装了 Yosemite 并将 Xcode 升级到 6.1。我启动 Xcode 选择了我的故事板,并发生了这些错误。
I checked that the correct storyboard was chosen in build settings and it is.
我检查了在构建设置中选择了正确的故事板,它是。
I tried to rename the storyboard and duplicate it and that of course hasn't worked. I'm not sure if I screwed something up a week ago when I was working on it or if the upgrade to Yosemite messed something up or what. I've looked online and haven't really found any help. Other than reading the errors it throws, I'm not really sure what else to check either.
我试图重命名故事板并复制它,当然这没有用。我不确定一周前我是否在工作时搞砸了某些事情,或者升级到优胜美地是否搞砸了某些事情或什么。我在网上查过,并没有真正找到任何帮助。除了阅读它抛出的错误之外,我也不确定还有什么要检查的。
If anyone has help or has knows of things I can check to help further diagnose the issue I'd greatly appreciate it.
如果有人有帮助或知道我可以检查以帮助进一步诊断问题的事情,我将不胜感激。
Here's screenshots of the errors. http://i62.tinypic.com/21r02p.pnghttp://i60.tinypic.com/2r4txsw.png
这是错误的屏幕截图。 http://i62.tinypic.com/21r02p.png http://i60.tinypic.com/2r4txsw.png
P.S. I should mention I'm looking for solutions that don't require me to recreate the entire thing again. I could do that, but I am hoping that I can find a solution that won't be as time consuming. Hoping this is a "simple" issue to fix.
PS我应该提到我正在寻找不需要我再次重新创建整个事情的解决方案。我可以这样做,但我希望我能找到一个不会那么耗时的解决方案。希望这是一个要解决的“简单”问题。
回答by RasTheDestroyer
I just had this issue and fixed it by deleting the file and reseting it in version control.
我刚刚遇到了这个问题,并通过删除文件并在版本控制中重置它来修复它。
If your project isn't in version control you could try:
如果您的项目不在版本控制中,您可以尝试:
- Copying the storyboard source
- Removing the file from the project
- Making a new storyboard with the same name
- Pasting the old storyboard source into the new file
- 复制故事板源
- 从项目中删除文件
- 制作一个同名的新故事板
- 将旧的故事板源粘贴到新文件中
回答by Okikioluwa
In my case, I edited my storyboard via a text editor and got the wrong set of double-quotes,if this is your case: it will be obvious when you open the storyboard file as source. (xml)
就我而言,我通过文本编辑器编辑了我的故事板并得到了错误的双引号集,如果这是您的情况:当您将故事板文件作为源打开时,这将是显而易见的。(xml)
Then the last item/Controller you were working on, Delete (or edit if you're familiar with the xml layout) and it will load normally
然后你正在处理的最后一个项目/控制器,删除(或编辑,如果你熟悉 xml 布局),它会正常加载