大佬教程收集整理的这篇文章主要介绍了iphone – 兼容使用iOS SDK 6.0开发iOS 5.1应用程序,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我只是想知道天气我可以使用SDK 6.0开发iOS 5.1应用程序.
我已经进行了如下图所示的配置.
您只需将“部署目标”设置为5.1即可.
然后你可以:
>要么只使用iOS5.1中提供的方法,要么不使用任何仅支持iOS6的方法来确保您的应用仍然可以在iOS5.1中运行
>或者在每次要调用仅在iOS6中可用的方法时在运行时执行检查,并且仅在可用时调用此方法(如果用户的iPhone具有支持此方法的最新版本的iOS) .
有关配置和示例案例的更多信息和详细说明,我强烈建议您阅读Apple文档中的SDK Compatibility Guide.
例如,如果您想提供一个按钮来分享社交网络上的内容,您可能希望使用Social.framework,但这个只能在iOS6上使用.因此,您可以为iOS6用户提出此功能,并提醒iOS5用户他们需要将iPhone更新到iOS6以使用此特定功能:
// Always test the availability of a class/method/... to use // instead of comparing the system version or whatever other method,see doc if ([SLComposeViewController class]) { // Only true if the class exists,so the framework is available we can use the class SLComposeViewController* composer = [composeViewControllerForserviCEType:SLserviCETypeFacebook]; // ... then present the composer,etc and handle everything to manage this } else { UIAlertView* alert = [[UIAlertView alloc] initWithtitle:@"Sharing unavailable" message:@"You need to upgrade to iOS6 to be able to use this feature!" delegate:nil cancelButtontitle:nil otherButtontitles:@"OK,will do!"]; [alert show]; [alert release]; }
然后简单地弱链接Social.framework(当您将框架添加到链接器构建阶段时,将“required”更改为“Optional”),如文档中详细说明的那样.
以上是大佬教程为你收集整理的iphone – 兼容使用iOS SDK 6.0开发iOS 5.1应用程序全部内容,希望文章能够帮你解决iphone – 兼容使用iOS SDK 6.0开发iOS 5.1应用程序所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。