在 5.0 中打开后无法在 Xcode 4.6 中打开项目
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17281073/
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
Can't Open Project in Xcode 4.6 After Opening in 5.0
提问by raginggoat
I opened the wrong version of my project in Xcode 5 and now Xcode 4.6 crashes when trying to open that project. I only changed one xib file in Xcode 5 and using Xcode 5 have opened the xib in IB and under Interface Builder Document, changed Opens in from Xcode 5.0 to Xcode 4.6. Any ideas why 4.6 crashes when opening the project?
我在 Xcode 5 中打开了错误版本的项目,现在 Xcode 4.6 在尝试打开该项目时崩溃。我只更改了 Xcode 5 中的一个 xib 文件,并且使用 Xcode 5 在 IB 和 Interface Builder Document 下打开了 xib,将 Opens in 从 Xcode 5.0 更改为 Xcode 4.6。任何想法为什么 4.6 在打开项目时崩溃?
EDIT:
编辑:
I made a copy of the project folder and now, even though all of the files are in the old project folder, none of them show in xcode 4.6 or 5 when I open the project. None of my images, class files, or anything are showing in xcode even though they are all still in the project folder.
我复制了项目文件夹,现在,即使所有文件都在旧项目文件夹中,当我打开项目时,它们都没有显示在 xcode 4.6 或 5 中。我的图像、类文件或任何东西都没有显示在 xcode 中,即使它们都仍在项目文件夹中。
回答by ecume des jours
Its easier than that to recover your existing project. Open the project file on Xcode 5. Then:
恢复现有项目比这更容易。在 Xcode 5 上打开项目文件。然后:
- Open file inspector for each xib
- On "Interface Builder Documents" section change "Open with" to Xcode 4.6 (if it's 5.0). Adjust any other obviously incompatible parameters
- Save, Close the project and open with the old Xcode.
- 为每个 xib 打开文件检查器
- 在“Interface Builder Documents”部分将“Open with”更改为 Xcode 4.6(如果是 5.0)。调整任何其他明显不兼容的参数
- 保存,关闭项目并使用旧的 Xcode 打开。
回答by thatzprem
Change the Interface Builder Documents
> opens in to Xcode 4.6
将Interface Builder Documents
> opens in更改为 Xcode 4.6
回答by pleonasmik
I found out that there is a way to change it without having Xcode5. Ff you open the Main.storyboard on a text editor like Sublime you will get something like
我发现有一种方法可以在没有 Xcode5 的情况下更改它。如果你在像 Sublime 这样的文本编辑器上打开 Main.storyboard 你会得到类似的东西
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4451" systemVersion="13A461" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3676"/>
</dependencies>
<scenes>
<!--class Prefix:identifier View Controller-->
<scene sceneID="ufC-wZ-h7g">
<objects>
<viewController id="vXZ-lx-hvc" customClass="TEViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
on the document line you will get a tag version that shows 3.0 (version="3.0"). Manually you can change from 3.0 to 2.0 or 1.0. Save the document and you will be able to open the file and to run it on the emulator (I haven′t check it performance on a real device yet).
在文档行上,您将获得一个显示 3.0 (version="3.0") 的标记版本。您可以手动从 3.0 更改为 2.0 或 1.0。保存文件,你就可以打开文件并在模拟器上运行它(我还没有在真机上检查它的性能)。
回答by pleonasmik
It's probably the case that opening the project in Xcode 5 caused it to upgrade the project to a new format automatically (even if you only manually changed one or two files). That upgrade is usually not-reversible. You can probably restore from a backup or from version control.
可能是在 Xcode 5 中打开项目导致它自动将项目升级为新格式(即使您只手动更改了一两个文件)。这种升级通常是不可逆的。您可能可以从备份或版本控制中恢复。
If you don't have a backup or version control, you should perhaps consider setting that sort of thing up before using beta / developer preview software on production projects that matter in the future.
如果您没有备份或版本控制,您或许应该考虑在将来在重要的生产项目上使用测试版/开发者预览版软件之前进行此类设置。
In that case, you can probably re-create the Xcode 4 project and re-add all your files, et cetera.
在这种情况下,您可能可以重新创建 Xcode 4 项目并重新添加所有文件,等等。
回答by Abdul Yasin
Actually this has a very simple answer.
其实这有一个非常简单的答案。
Open the Storyboard file on Xcode 5, And then: 1. Open file inspector 2. On "Interface Builder Documents" section change "Open with" to Xcode 4.6 (if it's 5.x). 3. Save, Close the project and open that with old Xcode.
在 Xcode 5 上打开 Storyboard 文件,然后: 1. 打开文件检查器 2. 在“Interface Builder Documents”部分将“Open with”更改为 Xcode 4.6(如果是 5.x)。3. 保存,关闭项目并用旧的 Xcode 打开它。
It should work now.
它现在应该可以工作了。
回答by Chris Alan
This is why because when you open project in xcode 5,All library and xib contol change based on xcode 5 so preview of both xcode 4.6 and 5 will be different.
这就是为什么当您在 xcode 5 中打开项目时,所有库和 xib 控制都基于 xcode 5 更改,因此 xcode 4.6 和 5 的预览会有所不同。
回答by Sanjay Kumar Yadav
Very simple to get your current project. Open the project file on Xcode 5. Then:
获取您当前的项目非常简单。在 Xcode 5 上打开项目文件。然后:
a).Open file inspector for each xib b).On "Interface Builder Documents" section change "Open with" to Xcode 4.6 (if it's 5.0). c).Adjust any other obviously incompatible parameters Press cmd +S (Save project), Close the project and open with the old Xcode.
a).为每个 xib 打开文件检查器 b).在“Interface Builder Documents”部分将“Open with”更改为 Xcode 4.6(如果它是 5.0)。c).调整其他明显不兼容的参数按cmd+S(保存项目),关闭项目,用旧的Xcode打开。