本文介绍了如何从uinavigationcontroller堆栈中删除特定的视图控制器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个uinavigationcontroller。登录后我想从UInavigationcontroller堆栈中删除诸如RegisterViewController,LoginViewController等视图控制器..
I have a uinavigationcontroller. After logged in i want to remove viewcontrollers like RegisterViewController,LoginViewController etc from UInavigationcontroller stack..
我的意思是我必须从堆栈中删除特定的视图控制器?怎么可能。 ?
I mean i have to remove a particular view controller from stack ? How its possible. ?
我查了这篇文章
所以我们可以把它变成一个数组,比如
So we can take it into an array like
NSArray *allviewcontrollers= [(UINavigationController *)navigationController viewControllers];
但是如何进一步处理..这个问题很长时间都在追捕..请回答我..谢谢提前
But how to do further process.. This question is hunting me for long time..Please answer me ..Thanks in advance
推荐答案
NSMutableArray *allViewControllers = [NSMutableArray arrayWithArray: navigationController.viewControllers];
[allViewControllers removeObjectIdenticalTo: removedViewController];
navigationController.viewControllers = allViewControllers;
这篇关于如何从uinavigationcontroller堆栈中删除特定的视图控制器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!