堆栈中删除特定的视图控制器

堆栈中删除特定的视图控制器

本文介绍了如何从 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. ?

我查看了这篇文章

http://starterstep.wordpress.com/2009/03/05/changeing-a-uinavigationcontroller's-root-view-controller/

所以我们可以把它放到一个像

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 堆栈中删除特定的视图控制器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 07:23