Xcode 4 为什么我在单击 MainStoryBoard.storyboard 时会看到 XML:似乎是一个错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9465361/
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 4 why do I see XML when clicking on MainStoryBoard.storyboard: seems like a bug
提问by user310291
In an Xcode project, I see XML when clicking on MainStoryBoard.storyboard instead of the graphical design, why and how to restore the right view ?
在 Xcode 项目中,我在单击 MainStoryBoard.storyboard 时看到 XML 而不是图形设计,为什么以及如何恢复正确的视图?
Update: I think it's a bug of XCode 4.2 because on another project, when I click on version editor I have XML but when I click on standard editor it shows visual design.
更新:我认为这是 XCode 4.2 的一个错误,因为在另一个项目中,当我点击版本编辑器时,我有 XML,但是当我点击标准编辑器时,它显示了视觉设计。
Is there a way to fix this and not to force me to recreate my visual design by hand once again ?
有没有办法解决这个问题,而不是强迫我再次手工重新创建我的视觉设计?
回答by Jonathan
To fix the issue, right-click MainStoryboard.storyboard, then choose "Open as >" and then "Interface Builder - iOS Storyboard".
要解决此问题,请右键单击 MainStoryboard.storyboard,然后选择“Open as >”,然后选择“Interface Builder - iOS Storyboard”。
回答by Besi
回答by Edwin Ikechukwu Okonkwo
This worked for me using xcode 6
这对我使用 xcode 6
回答by SeanK
I've run into this issue, but it was a bit different. I had a merge issue with Git on my storyboard, so I had to manually edit the XML to resolve the conflict. After this, there was no 'Interface Builder-iOS Storyboard' option available in the "Open as" menu so I couldn't change it back to the visual editor. To fix this I simply restarted XCode and everything went back to normal.
我遇到了这个问题,但它有点不同。我的故事板上有一个 Git 合并问题,所以我不得不手动编辑 XML 来解决冲突。此后,“打开为”菜单中没有“界面生成器-iOS 故事板”选项可用,因此我无法将其改回可视化编辑器。为了解决这个问题,我只是重新启动了 XCode,一切都恢复了正常。
回答by piersb
After using SeanK's solution (restart XCode) I still manually needed to right-click the storyboard and choose Open as > Interface Builder - iOS Storyboard.
使用 SeanK 的解决方案(重新启动 XCode)后,我仍然需要手动右键单击情节提要并选择打开为 > 界面生成器 - iOS 情节提要。
回答by Viktor Kucera
If you have more than just one storyboard go back and forth - click different one, go back to the one you want to display as an iOS storyboard. It's not XML any longer.
如果您有多个故事板,请来回切换 - 单击不同的故事板,返回到要显示为 iOS 故事板的那个。它不再是 XML。
回答by Dalal Alharbi
Change the extension like this "your_storyboard.storyboard" then right-click MainStoryboard.storyboard, then choose "Open as >" and then "Interface Builder - iOS Storyboard".
像这样更改扩展名“your_storyboard.storyboard”,然后右键单击 MainStoryboard.storyboard,然后选择“Open as >”,然后选择“Interface Builder - iOS Storyboard”。