我正在尝试在我的Parse应用程序中创建一个UIAlertView,但是每次运行它时,它都会崩溃,并且我被带到ApplicationDelegate,那里我收到了一个SIGABRT。这是我的警报代码,我相信我没有做错任何事情,因为它之前曾经工作过...难道是因为我从Parse加载数据到表格视图中吗?
func displayAlert(title: String, message: String) {
var alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: { (action) -> Void in
}))
presentViewController(alert, animated: true, completion: nil)
}
displayAlert
函数的附近。-- 还要检查title
或message
是否为nil
。 - Mundi