Ios 使用UIAlertController的项目。如何使用Xcode 5.1构建IPA文件?

Ios 使用UIAlertController的项目。如何使用Xcode 5.1构建IPA文件?,ios,objective-c,xcode,ipa,uialertcontroller,Ios,Objective C,Xcode,Ipa,Uialertcontroller,我的项目正在使用UIAlertController。工作正常,我可以在Xcode 6.1上构建IPA文件 但是当我尝试在Xcode 5.1上构建IPA文件时。它不起作用,因为Xcode 5.1找不到“UIAlertController”的接口声明。有什么想法吗 对不起,我的英语不好。这是不可能的UIAlertController是在iOS 8中引入的,只有Xcode 6+支持iOS 8+ 正如苹果在UIAlertController上的文档所示,该类“在iOS 8.0及更高版本中可用”。来源如下

我的项目正在使用UIAlertController。工作正常,我可以在Xcode 6.1上构建IPA文件

但是当我尝试在Xcode 5.1上构建IPA文件时。它不起作用,因为Xcode 5.1找不到“UIAlertController”的接口声明。有什么想法吗


对不起,我的英语不好。

这是不可能的<代码>UIAlertController是在iOS 8中引入的,只有Xcode 6+支持iOS 8+

正如苹果在
UIAlertController
上的文档所示,该类“在iOS 8.0及更高版本中可用”。来源如下:

UIAlertViewController是iOS 8的新功能,仅在针对iOS 8及更高版本时才起作用。它是UIActionSheet的替代品。如果您的代码必须是7兼容的,那么您可能应该使用它或两者兼用

这篇文章展示了如何检测不同的iOS版本


你不能。。UIAlertController可用于xcode 6和ios 8。编译器Xcode 5.1不理解它将给出错误

如果您想在iOS 6及以上版本的项目中使用UIAlertView或UIActionSheet旁边的UIAlertController,请尝试此操作。 它在Xcode 7.3和Xcode 5.1中为我编译

Class UIAlertControllerClass = NSClassFromString(@"UIAlertController"); //So that Xcode 5 won't complain about not knowing what is UIAlertController.

if (UIAlertControllerClass)
{
    #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 //So Xcode 5 won't worry about your UIAlertController code since it was introduced in iOS 8.

    //UIAlertController code goes here.

    #endif
}
else
{
    //UIAlertView or UIActionSheet code goes here.
}

你为什么需要在Xcode 5.1中构建而不是在Xcode 6.1中构建?你已经解决了这个问题吗?我想为ios 6构建。我的项目接受ios 6及以上版本。