Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/108.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在iOS 8上,presentViewController因EXC\u坏访问而崩溃_Ios_Iphone_Swift_Ios8 - Fatal编程技术网

在iOS 8上,presentViewController因EXC\u坏访问而崩溃

在iOS 8上,presentViewController因EXC\u坏访问而崩溃,ios,iphone,swift,ios8,Ios,Iphone,Swift,Ios8,虽然在iOS 7中,一切都很有魅力,但presentViewController:函数在iOS 8中多次使用时会崩溃 var navigationController = storyboard.instantiateInitialViewController() as! UINavigationController presentViewController(navigationController, animated: true, completion: nil) 上面的代码执行一次,没有任

虽然在iOS 7中,一切都很有魅力,但presentViewController:函数在iOS 8中多次使用时会崩溃

var navigationController = storyboard.instantiateInitialViewController() as! UINavigationController
presentViewController(navigationController, animated: true, completion: nil)
上面的代码执行一次,没有任何问题,navigationController显示得非常完美。关闭此navigationController并再次执行上述代码会导致应用程序因EXC_BAD_访问错误而崩溃

用于解除navigationController的代码如下所示:

self.dismissViewControllerAnimated(true, completion: nil)
注1:storyboard和navigationController属性始终具有正确的实例。我已经通过虚拟控制台确认了自己

注2:它并不总是在第二次,而是在第三次或第四次迭代中


有人能告诉我为什么会发生这种情况吗?

启用僵尸,并启用异常断点以查看崩溃的确切线路。

经过一段时间并在不同设备上进行测试后,我意识到这是iOS 8.0.0的一个bug。在iOS8.0.1-8.0.3之间解决的错误


我的办公室中有不同iOS版本的不同设备,问题只出现在8.0.0设备中。

崩溃的确切原因是:presentViewController(navigationController,动画:true,完成:nil)