我有三个相关的视图,它们都连接到导航控制器,带有推送序列(我也使用 prepare for segue 存储了所有三个数组)。所以我想使用dismiss,因为我不想更改视图控制器中使用的已经存在的存储数组。
所以我在 viewcontroller C ,我试图回到 A。
在此之前我一直使用self.dismiss(animated: true, completion: nil)
这在关闭视图 B 时效果很好,但我想去 A。
我也尝试过使用:
let presentingViewController = self.presentingViewController
presentingViewController?.presentingViewController?.presentingViewController?.dismiss(animated: false, completion: nil)
但是,这不起作用,并产生此错误:
pushViewController:animated:在现有过渡或演示发生时调用;导航堆栈将不会更新。
有什么解决办法吗?
我想去viewcontroller A的原因是因为在Viewcontroller C上更新某些东西时Viewcontroller B中有一个错误,所以临时的解决方案是去A,然后重新加载tableview。