【发布时间】:2015-09-19 07:40:12
【问题描述】:
我正在使用子类 UINavigationController 来管理我的应用程序中的所有视图控制器。它在主流程中推送和弹出视图控制器,并以模态方式呈现和关闭那些任意需要的视图控制器。
在一种情况下,我需要在主流程中弹出另一个视图控制器之前以模态方式呈现一个视图控制器,如下所示:
//Called in custom UINavigationController subclass
[self presentViewController:searchVC animated:YES completion:^{
[self popViewControllerAnimated:NO];
}];
上面的代码在 iOS 8 之前可以顺利运行,但在 iOS 9 中无法运行。当关闭呈现的 vc 时,仍然保留与以前相同的 viewController。
此外,这正在控制台中记录:
popViewControllerAnimated: called on <CustomNavigationController 0x7d846600> while an existing transition or presentation is occurring; the navigation stack will not be updated.
到目前为止,这从来都不是问题,尤其是在完成块中调用了 popViewController 方法。
这可能是一个错误吗?
欢迎任何解决方案/建议/解决方法。
【问题讨论】:
标签: ios objective-c uiviewcontroller uinavigationcontroller ios9