简体   繁体   English

无法在Xcode中打开XIB

[英]Can't Open XIB in Xcode

I get this message from Xcode when I try to edit the xib for one of my apps. 当我尝试为我的一个应用程序编辑xib时,我从Xcode收到此消息。

_The document "ViewController_iPhone.xib" could not be opened. _文档“ ViewController_iPhone.xib”无法打开。 This version of Xcode does no support Auto Layout for iOS documents. 此版本的Xcode不支持iOS文档的自动版式。 Edit this document with a newer version of Xcode. 使用更新版本的Xcode编辑此文档。

I have Xcode version "4.4" 我有Xcode版本“ 4.4”

You may have this problem if the XIB file was originally created in Xcode version 4.5+ (current preview version as of now is 4.5). 如果XIB文件最初是在Xcode版本4.5+(当前的当前预览版本为4.5)中创建的,则可能会遇到此问题。 Auto Layout is a new feature that wasn't supported previously with older versions of Xcode. 自动布局是一项新功能,以前的Xcode版本不支持。

Go to the developer portal and download 4.5 Preview Xcode and try that out. 转到开发人员门户并下载4.5 Preview Xcode并尝试一下。

Simple Solution: 简单的解决方案:

  1. Right click on .xib file -> open as "Source Code". 右键单击.xib文件->以“源代码”打开。

  2. Find & delete object (some int/Hex) from xib source code. 从xib源代码中查找并删除对象(某些int / Hex)。

  3. Save File. 保存存档。

  4. Again right click & open xib as "Interface Builder". 再次右键单击并打开xib作为“ Interface Builder”。

It will open your corrupt .xib file & u will not loss whole update in project. 它将打开损坏的.xib文件,您不会丢失项目中的整个更新。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM