在我的 View Controller 中,我有以下代码来创建 UIAlertController
:
var avc = UIAlertController(title: "Location", message: "Please Enter A Location", preferredStyle: UIAlertControllerStyle.Alert)
self.navigationController!.presentViewController(avc, animated: true, completion: nil)
在模拟器中运行,我明白了
确定这是 Xcode 6 beta 7 或 swift 中的错误?想法?
最佳答案
找到答案了,我应该向 UIAlertController
添加一个 Action 来显示消息:
alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil))
关于swift - Xcode 6 或 iOS 8 错误 : UIAlertController Not Showing Message?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25713001/