当我使用 lldb 关闭 Controller 时,我的应用程序出现问题,我没有做错任何事情,我将在此处提供项目和示例代码:
我在这里展示它:
func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
var cont = storyboard?.instantiateViewControllerWithIdentifier("Detail") as! Detail
cont.link = indexPath.row
self.view.window?.rootViewController?.presentViewController(cont, animated: true, completion: nil)
}
并在这里关闭它:
@IBAction func disiss(sender: AnyObject) {
self.dismissViewControllerAnimated(true, completion: nil)
}
我的项目在这里: https://yadi.sk/d/pSscby7ZicqSU
我认为当尝试快速打开和关闭以及快速打开和关闭时会出现问题!有时我只是打开它并解雇它,它就崩溃了!我正在 iPhone 6 上进行测试。我刚刚在模拟器 iPhone 6 上试过它,但它崩溃了。
最佳答案
在 ViewController.swift 中
替换
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
}
与
override func viewDidLoad() {
super.viewDidLoad()
}
关于ios - 关闭 View Controller 使应用程序崩溃(lldb),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32176105/