“不支持多次推送相同的视图控制器实例"例外 [英] "Pushing the same view controller instance more than once is not supported" exception
本文介绍了“不支持多次推送相同的视图控制器实例"例外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用以下代码检索一些邮件并将它们放入我的收件箱.
I am using the following code to retrieve some messages and putting them into my inbox.
MyInboxVC *inboxVC=[MyInboxVC get ];
//upload all the pending messages
UINavigationController *devNavController=[[MyappMgr get]getDeveloperNavigationController ];
[devNavController pushViewController:inboxVC animated:YES];
[devNavController setNavigationBarHidden:NO];
我得到了异常
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Pushing the same view controller instance more than once is not supported (<MyInboxVC: 0x1452a0>)'
什么意思?我做错了什么?
What does it mean? What am I doing wrong?
推荐答案
我相信,当您非常快速地执行某些操作时,这种情况也会发生.我构建了这样的东西:
I believe when you do some actions really fast this can happens too. I build something in like this:
if(![self.navigationController.topViewController isKindOfClass:[YOURCLASS class]]) {
这篇关于“不支持多次推送相同的视图控制器实例"例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文