Xcode 4中的iOS 3.x支持 [英] iOS 3.x support in Xcode 4

查看:83
本文介绍了Xcode 4中的iOS 3.x支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用Xcode 4编写支持iOS 3.x版本的应用程序?如果是这样,怎么样? Apple是否对app向后兼容性有任何官方建议?

Is it possible to write apps that support iOS 3.x versions using Xcode 4? If so, how? And does Apple have any official recommendations on app backwards-compatibility?

推荐答案

让你的应用在iOS 3.x设备中成功运行,请按照以下步骤操作(Xcode 4.2):

To get your app successfully run in iOS 3.x device, follow these steps (Xcode 4.2):


  1. 单击您的项目名称,选择目标并在构建设置下

  1. Click on your project name, select your Target and under "Build Settings"

a)将iOS开发目标(在部署下)设置为3.0

a) Set "iOS development target" (under "Deployment") to 3.0

b)。将armv6添加到架构列表中(在架构下)。

b). Add "armv6" to list of "Architectures" (under "Architectures").

c)将其他链接器标志(在链接下)设置为-weak-lSystem。

c) Set "Other Linker Flags" (under "Linking") to "-weak-lSystem".

在Info.plist文件中,从必需的设备功能(UIRequiredDeviceCapabilities)中删除armv7的值。

In your Info.plist file remove value of "armv7" from "Required device capabilities" (UIRequiredDeviceCapabilities).

在您的代码中:

a)。不要使用 userInterfaceIdiom 。如果你需要知道它是什么设备(iPhone或iPad),请参阅如何让UI_USER_INTERFACE_IDIOM()与iPhone OS SDK一起使用< 3.2

a). Do not use userInterfaceIdiom. If you need to know, what device is it (iPhone or iPad), see How does one get UI_USER_INTERFACE_IDIOM() to work with iPhone OS SDK < 3.2.

b)不要使用window.rootViewController。而是使用 [window addSubview:self.mainViewController.view]; 将主控制器的视图添加到窗口。

b) Do not use window.rootViewController. Instead use [window addSubview: self.mainViewController.view]; to add your main controller's view to window.

单击您的项目名称,选择您的目标,然后在Build Phases/Link Binary With Libraries下将UIKit.framework设置为Optional。还设置为可选的任何额外框架,这在iOS 3中不可用。例如,如果您使用的是iAd或Twitter框架,则应将它们设置为可选。在使用之前检查代码中额外框架的可用性。

Click on your project name, select your Target and under "Build Phases" / "Link Binary With Libraries" set "UIKit.framework" to "Optional". Also set to optional any extra framework, which is not available in iOS 3. For example, if you're using iAd or Twitter frameworks they should be set to optional. Check availability of extra framework in your code before use.

在真实设备上运行时,针对最新版本的SDK编译app。为此,请从方案下拉列表中选择第二项(否则您将收到与可选SDK相关的编译错误):

When run on real device, compile app against last version of SDK. To do so, select second item from "Scheme" drop down (otherwise you'll get compile error related to your optional SDKs):

这篇关于Xcode 4中的iOS 3.x支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆