我刚刚将XCode升级到4.5并安装了SDK 6.0。我发现SDK 5.0已经消失,但我仍然可以下载iPhone 5.0模拟器。
我想知道是否可以使用SDK 6.0来开发iOS 5.1的应用程序。我已经进行了如下图片中所示的配置。
我想知道是否可以使用SDK 6.0来开发iOS 5.1的应用程序。我已经进行了如下图片中所示的配置。
任何iOS SDK都允许您开发先前版本的操作系统。例如,即使使用iOS6 SDK,您也可以为iOS5开发。
您只需要将“部署目标”设置为5.1。
然后,您可以:
有关更多信息和配置及示例情况的详细说明,我强烈建议阅读Apple文档中的SDK兼容性指南。
例如,如果您想提供一个按钮来分享社交网络上的内容,则可能希望使用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”),如文档中详细说明。
是的,您仍然可以使用iOS 6 SDK创建与iOS 5兼容的应用程序。您必须相应地设置部署目标(如您所做的那样),并且不使用任何iOS 6功能。
#if!LIGHTVERSION /#endif
条件来停用代码的某些部分),这将与5.0兼容...和相同应用程序的“完整”版本将包括更多功能,只能与iOS 6.0兼容。在这种情况下,您的“LightApp”目标使用iOS5的部署目标,而您的“FullApp”目标使用iOS6的Dep Target是有意义的。_这只是一个例子;) _ - AliSoftware