【发布时间】:2014-11-20 10:57:19
【问题描述】:
我正在开发一个需要在 iOS 7 和 8 上运行的应用程序。如果可能,我想使用 UIAlertController,如果不回退到 UIAlertView。
我用这个测试:
let gotUIAlertController:AnyClass? = NSClassFromString("UIAlertController")
if( gotUIAlertController != nil )
{
// Do UIAlertController
}
else
{
// DO UIAlertView
}
这似乎适用于 iOS8 模拟器,处于调试模式,但在发布模式(或使用仪器运行调试模式)时,gotUIAlertController 不为零,因此 UIAlertController 正在尝试呈现并且应用程序崩溃。部署目标是 7.1,bas SDK 设置为 8.1
谁能告诉我为什么这段代码在 iOS7.1 上以这种方式执行?
【问题讨论】:
标签: ios swift uialertview ios7.1 uialertcontroller