ios 文档 Main.storyboard 需要 Xcode 8.0 或更高版本
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/37851459/
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 Main.storyboard requires Xcode 8.0 or later
提问by Bhumit Mehta
I downloaded Xcode beta and opened my existing project to see how it works with Xcode 8 beta (I opened Storyboard file from Xcode 8).
我下载了 Xcode beta 并打开了我现有的项目以查看它如何与 Xcode 8 beta 一起使用(我从 Xcode 8 打开了 Storyboard 文件)。
Now when I open my project from Xcode 7.3 I am not able to open storyboard file , it gives me following error
现在,当我从 Xcode 7.3 打开我的项目时,我无法打开故事板文件,它给了我以下错误
This version does not support documents saved in the Xcode 8 format. Open this document with Xcode 8.0 or later.
此版本不支持以 Xcode 8 格式保存的文档。使用 Xcode 8.0 或更高版本打开此文档。
What should I do to revert back, as I want to continue working on Xcode 7.
我应该怎么做才能恢复,因为我想继续在 Xcode 7 上工作。
In Xcode 8 I was prompted to select device and I selected iPhone 6S, I think that part is somehow responsible for storyboard file not opening in Xcode 7
在 Xcode 8 中,我被提示选择设备,然后我选择了 iPhone 6S,我认为该部分以某种方式导致故事板文件未在 Xcode 7 中打开
回答by Bhumit Mehta
I have figured it out:
我已经想通了:
Open your Storyboard in Xcode 8.
在 Xcode 8 中打开您的故事板。
Click on the File Inspector.
单击文件检查器。
In Interface Builder Documentsection, select Opens In "Xcode 7.x" instead of "Latest Xcode (8.0)", as in following screenshot:
在Interface Builder Document部分,选择 Opens In "Xcode 7.x" 而不是 "Latest Xcode (8.0)",如下图所示:
On doing this, you will get an alert saying "Saving for Xcode 7.x will close your document and data for Xcode 8.0 features will be removed."
执行此操作时,您将收到一条警告,提示“为 Xcode 7.x 保存将关闭您的文档,并且将删除 Xcode 8.0 功能的数据。”
Click Save and Close and you will be able to open storyboard in Xode 7.x.
单击保存并关闭,您将能够在 Xode 7.x 中打开故事板。
回答by Himanshu
I have a solution:
我有一个解决方案:
- Open storyboard as "source Code" (right click on storyboard -> open as -> source code).
- Delete this row:
- 将故事板作为“源代码”打开(右键单击故事板 -> 打开为 -> 源代码)。
- 删除这一行:
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
- Delete this for all storyboards which you are using.
- Run app.
- 删除您正在使用的所有故事板。
- 运行应用程序。
回答by Preeti
It's work for me
这对我有用
Right,click on main.stoaryboard.Go to open as -> source code and change dependencies
右键,单击 main.stoaryboard.Go 以打开为 -> 源代码并更改依赖项
change
改变
<capability name="documents saved in the Xcode 8 format"
minToolsVersion="8.0"/> to
<capability name="documents saved in the Xcode 7 format"
minToolsVersion="7.0"/>
Follow the same step on launchscreen.stoaryboard
在 launchscreen.stoaryboard 上执行相同的步骤
回答by Amit
Same issue occurred after shifting from Xcode 9 to Xcode 8. I opened the storyboard in source code and changed
从 Xcode 9 转移到 Xcode 8 后发生了同样的问题。我在源代码中打开了故事板并进行了更改
"<capability name="Safe area layout guides" minToolsVersion="9.0"/>"
to <capability name="Safe area layout guides" minToolsVersion="8.0"/>
After this change when you will open storyboard in Interface builder this line will be removed.
在此更改后,当您在界面构建器中打开故事板时,将删除此行。
回答by Michael Tangs
I met this question too. I followed this method to change it: because I couldn't click the menu to choose 7.0 or later, I opened the main.storyboard
and launchscreen.storyboard
with source code, than I changed it's version manually and this solved the issue.
我也遇到了这个问题。我按照这个方法来改变它:因为我无法点击菜单选择7.0或更高版本,我用源代码打开main.storyboard
和launchscreen.storyboard
,然后手动更改它的版本,这解决了问题。
回答by Dimmy3
Since XCode 8 constantly keeps converting storyboard files to XCode 8 format every time I open it (it's an old project, and everything gets messed up), I ended up downloading XCode 7 and using it just to edit storyboard files (and close it before i switch back to XCode 8). If I accidentally open storyboard file in 8, I just reset that file to the last commit, since the project is on GIT.
由于每次打开 XCode 8 时都会不断将故事板文件转换为 XCode 8 格式(这是一个旧项目,一切都变得一团糟),因此我最终下载了 XCode 7 并仅使用它来编辑故事板文件(并在我之前关闭它)切换回 XCode 8)。如果我不小心在 8 中打开了故事板文件,我只需将该文件重置为最后一次提交,因为该项目在 GIT 上。
Stupid, I know, but it works.
愚蠢,我知道,但它有效。
回答by Jason
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
Replace your dependencies to this dependencies
将您的依赖项替换为此依赖项
回答by iOS_Developer
Open storyboard as Source Code
and search for minToolsVersion
key. Set that value as 7.0 and open that storyboard in Xcode 7.x
打开故事板作为Source Code
并搜索minToolsVersion
关键。将该值设置为 7.0 并在 Xcode 7.x 中打开该情节提要
回答by byJeevan
As @Bhumit_Metha given straight forward solution. Unfortunately, in my case I don't have MAC with latest Xcode (8.0+) version make those changes to support new 'xib' files in my old xcode (7.x).
正如@Bhumit_Metha 给出的直接解决方案。不幸的是,就我而言,我没有最新 Xcode (8.0+) 版本的 MAC 进行这些更改以支持旧 xcode (7.x) 中的新“xib”文件。
So I ended up with a working solution with simple steps as follows :
所以我最终得到了一个工作解决方案,步骤简单如下:
[1] Create a empty xib file in your xcode 7.x.
[1] 在你的 xcode 7.x 中创建一个空的 xib 文件。
[2] Right click on the empty xib to view source and copy all of that.
[2] 右键单击空的 xib 以查看源代码并复制所有内容。
[3] Now open new xib (one with version error) in source viewer. Paste previous code on top.
[3] 现在在源代码查看器中打开新的 xib(一个版本错误)。将之前的代码粘贴在上面。
[4] Replace all the lines of old with new inside tag :
<objects> ...... </objects>
[4] 用新的内部标签替换旧的所有行:
<objects> ...... </objects>
And that's all. Will work with compatible to xcode 7.x!
就这样。将与 xcode 7.x 兼容!
Tip : While opening next time in new xcode, make sure to select compatibility mode.
提示:下次在新的 xcode 中打开时,请确保选择兼容模式。