美文网首页
低版本的xcode打开xcode8上的xib错误

低版本的xcode打开xcode8上的xib错误

作者: Finger_s | 来源:发表于2017-03-13 14:09 被阅读0次

XIB和Storeboard适配
在Xcode8之前,创建一个XIB或SB文件,都是一个600*600的方块XIB文件。在Xcode8之后,创建的XIB文件默认是6s尺寸的大小。

   但是Xcode8打开之前旧项目的XIB或SB文件时,会弹出下面的弹框, 这时候一般直接选择Choose Device即可。
Choose an initial device view
    但是这样有个问题,如果Xcode8打开过这个XIB文件,并选择Choose Device之后。其他的Xcode8以下版本的编译器,将无法再打开这个文件,会报以下错误:

The document “ViewController.xib” requires Xcode 8.0 or later. This version does not support documents saved in the Xcode 8 format. Open this document with Xcode 8.0 or later.

有两种方法解决这个问题:

  1. 你同事也升级Xcode8,比较推荐这种方式,应该迎接改变。

2.右击XIB或SB文件 -> Open as -> Source Code,删除xml文件中下面一行字段。
<pre>
<capability.name = "documents saved in the Xcode8 format" minToolsVersion = "8.0"/> <pre>

相关文章

网友评论

      本文标题:低版本的xcode打开xcode8上的xib错误

      本文链接:https://www.haomeiwen.com/subject/qiwfnttx.html