Я попытался вернуться к viewcontroller, когда пользователь нажал Перейти домой в alertView, и он покажет мне ошибку (libC++ abi.dylib: завершение с неперехваченным исключением типа NSException)Как вернуться к viewcontroller в alertview
@IBAction func roundButton(sender: AnyObject) {
//add alert
alertController = UIAlertController(title: "Return Home", message: "Are you sure???", preferredStyle: .Alert)
let alertAction1 = UIAlertAction(title: "Cancel", style: .Default) { (action) in
}
let alertAction2 = UIAlertAction(title: "Go Home", style: .Destructive) { (action) in
let nv = self.storyboard!.instantiateViewControllerWithIdentifier("storyboardidentifier") as! ViewController
self.presentViewController(nv, animated:true, completion:nil)
}
alertController?.addAction(alertAction2)
alertController?.addAction(alertAction1)
self.presentViewController(alertController!, animated: true, completion: nil)
//end alert
}
Можете ли вы показать мне сообщение Exception? Обычно появляется сообщение, за которым следует исключение, непосредственно перед трассировкой стека. – Sweeper