解决方案 »

  1.   

    alertView.delegate=self
    回调方法写了没?
      

  2.   

    查了一下文档,得知UIAlertView在iOs8已经是depreciated的哦,同时init方法带参数初始化已经取消,目前还是可以通过你的第二种方法来实现,但Apple已经提供了替代品:let alertController = UIAlertController(title: "标题", message: "内容", preferredStyle: UIAlertControllerStyle.Alert)
    alertController.addAction(UIAlertAction(title: "确认", style: UIAlertActionStyle.Default, handler: nil))
    self.presentViewController(alertController, animated: true, completion: nil)意思是把Alert提到了ViewController的等级,个人感觉这样挺好的