Dou*_*one 51 iphone uinavigationcontroller ios segue
所以我正在制作一个带有5个视图控制器的应用程序,第一个嵌入在UINavigationController中,前4个视图控制器之间的segue工作正常.然而,引入第五个视图控制器已经破坏了这一点,我收到了错误
Terminating app due to uncaught exception 'NSGenericException', reason: 'Push segues can only be used when the source controller is managed by an instance of UINavigationController.'
Run Code Online (Sandbox Code Playgroud)
我没有做任何与这个第五视图控制器不同的东西,它只是一个带有图像视图和标签的标准ViewController,我的所有segue都是通过故事板中的ctrl拖动按钮来调用的.有没有人知道这是什么造成的?
谢谢
Kir*_*ela 153
将Navigation Controller添加到初始视图中
Gas*_*ton 14
在我的情况下,当原始VC执行segue时,导航控制器正在转换并且已经改变了他可见的VC.
我解决了这个问题:
if (self.navigationController.visibleViewController == self) {
[self performSegueWithIdentifier:@"thankyou" sender:self];
}
Run Code Online (Sandbox Code Playgroud)
不再崩溃.:)
| 归档时间: |
|
| 查看次数: |
43980 次 |
| 最近记录: |