简体   繁体   English

如何在旧版本的Xcode中打开Xcode项目?

[英]How can I open an Xcode project in an older version of Xcode?

I need to open an Xcode project in older Xcode version to build under the older SDK. 我需要在旧版Xcode中打开一个Xcode项目,以在旧版SDK下进行构建。 What is deployment target option mean in "project settings". “项目设置”中的部署目标选项是什么意思。 Does it mean that I can build my project on latest iOS 4.3 SDK for an iPhone OS 3 device? 这是否意味着我可以在适用于iPhone OS 3设备的最新iOS 4.3 SDK上构建项目? How about some functions in classes that dont support in older version of SDK? 在旧版SDK中不支持的类中的某些功能怎么样?

Base SDK is the version of the iOS SDK API that your app is compiled with. 基本SDK是与您的应用程序一起编译的iOS SDK API的版本。 This means that your app is being built with the libraries for that version of iOS. 这意味着您的应用是使用该版本的iOS的库构建的。 As Black Frog mentioned, you must use the latest SDK to get your app approved on the App Store. 如Black Frog所述,您必须使用最新的SDK才能在App Store上批准您的应用。

Deployment Target is the minimum version of iOS on which your app will allow itself to run on. 部署目标是您的应用将允许在其上运行的最低iOS版本。 (The App Store prevents older vesions of iOS from installing apps with a Deployment Target that is newer than that version.) (App Store阻止iOS的较旧版本安装具有比该版本新的Deployment Target的应用程序。)

If you wanted your app to use, say, Game Center (which requires iOS 4.1), and run on iOS 3.1.3 or higher, then you would use a Base SDK of 4.1 or higher and a Deployment Target of 3.1.3. 如果您想让您的应用使用Game Center(需要iOS 4.1)并在iOS 3.1.3或更高版本上运行,则可以使用4.1或更高版本的基本SDK和3.1.3的部署目标

To deal with classes and methods that don't exist, you should check if they exist before using them. 要处理不存在的类和方法,应在使用它们之前检查它们是否存在。 Here's a great blog post on managing different versions of iOS and different versions of the SDK. 这是一篇有关管理不同版本的iOS和不同版本的SDK 的精彩博客文章

All Xcode projects since 3.2 have had the same internal format. 从3.2开始,所有Xcode项目都具有相同的内部格式。 So, you should be able to open the Xcode project in the older Xcode. 因此,您应该能够在较旧的Xcode中打开Xcode项目。 In Xcode 3, you can see the project format version in the "Get Info" of your project. 在Xcode 3中,您可以在项目的“获取信息”中查看项目格式的版本。 (I haven't found this yet in Xcode 4.) (我尚未在Xcode 4中找到它。)

  1. Xcode v4 and v3 share the same project format, that should not be a problem to open it. Xcode v4和v3共享相同的项目格式,打开它应该不是问题。
  2. Depending on your code , you will have to check it is working for the lower version SDK: 根据您的代码 ,您将必须检查它是否适用于较低版本的SDK:

    1. Set your Build SDK and Deployment target in project 在项目中设置Build SDKDeployment target
    2. Build & Check results that should warn/fail 构建并检查应警告/失败的结果
    3. Make sure to check Apple documentations to see if you're not using not yet existing APIs. 确保检查Apple文档,以查看您是否尚未使用尚不存在的API。
    4. Do tests on a real device using that OS version... ( very important!! ) 使用该OS版本在真实设备上进行测试...( 非常重要!!

If there is a magical way to check iOS compatibility not by hand like this, I'm interested :) 如果有一种神奇的方法可以像这样不手动检查iOS兼容性,我很感兴趣:)

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

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