iOS 3.x support in Xcode 4(Xcode 4 中的 iOS 3.x 支持)
问题描述
是否可以使用 Xcode 4 编写支持 iOS 3.x 版本的应用程序?如果是这样,怎么做?Apple 是否对应用程序的向后兼容性有任何官方建议?
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):
点击您的项目名称,选择您的目标并在构建设置"下
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).
在您的代码中:
一).不要使用 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 编译应用程序.为此,请从方案"下拉菜单中选择第二项(否则您将收到与可选 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 支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Xcode 4 中的 iOS 3.x 支持


基础教程推荐
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01