2016-07-26 87 views
-3

当与迅速,编译器IOS 9 I用户alertview示出了该警告消息:使用在IOS 9 alertview与迅速

UIAlertView中”在IOS 9.0被弃用:UIAlertView中已被弃用。使用UIAlertController与UIAlertControllerStyleAlert的preferredStyle代替

+1

是的,像有消息称,它已过时。检查这个喜欢的文档:可能解决你的问题http://stackoverflow.com/documentation/ios/874/uialertcontroller#t=201607261258026665057 – Idan

+2

你的问题是什么? – fantaghirocco

+3

[UIAlertView首次弃用IOS 9]的可能重复(http://stackoverflow.com/questions/32690086/uialertview-first-deprecated-ios-9) –

回答

0

尝试使用此代码

let alert = UIAlertController(title: "TITLE", message: "MESSAGE", preferredStyle: UIAlertControllerStyle.Alert) 
      let okAction = UIAlertAction(title:"OK", style: UIAlertActionStyle.Cancel, handler: { (action) -> Void in 
      }) 
      alert.addAction(okAction) 
      dispatch_async(dispatch_get_main_queue(),{ 
       self.presentViewController(alert, animated: true, completion: nil) 
      })