支持 iOS 4.3 到 iOS 6.0 [英] Supporting iOS 4.3 to iOS 6.0

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

问题描述

我已经有了支持ios 4.3到ios 5的基础代码,现在我也想支持ios 6.0.目前的基本代码有modal views,硬编码CGRect's,每个视图的旋转是不同的.所以我想知道我们是否可以通过相同的基本代码支持 ios 4.3 到 ios 6.0,只需调整一些更改,还是我们需要创建一个完整的新目标?

I already have the base code that supports ios 4.3 to ios 5. Now I would also like to support ios 6.0. The present base code has modal views, hard coded CGRect's, and rotation is different for each view. So I would like to know whether we can support ios 4.3 to ios 6.0 with the same base code, by just tweaking some changes, or do we need to create a complete new target?

如果我想支持以前的版本,我们不能使用 ios 6.0 的自动布局,因为它会导致崩溃.

Like we cannot use auto layout of ios 6.0 if I want to support previous versions as it will lead to a crash.

推荐答案

是的,我们可以通过将部署目标设置为 iOS 4.3 来做到这一点.但是,你为什么需要支持iOS <5.0,因为大约 85-90% 的设备使用 iOS 5.0+.请参阅

Yes, we can do this by setting up the Deployment Target to iOS 4.3. But then, why do you need to support iOS < 5.0 as around 85-90% of devices are on iOS 5.0+. See this

此外,当您设置对 iOS 4.3 甚至 iOS 5.1.1 的支持时,您将不得不处理多种事情.比如Orientation的方法,

Also, when you set up support for iOS 4.3 or even iOS 5.1.1, you would have to handle multiple things. For example, the method for Orientation,

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

iOS 6 不调用它.它被方法替换,

isn't called for iOS 6. It is replaced by the methods,

- (NSUInteger)supportedInterfaceOrientations

- (BOOL)shouldAutorotate

您需要设备上的所有 iOS 版本,然后测试应用程序的各个方面.

You would need all the iOS versions on devices and then test each and every aspect of your app.

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

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