Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

popping to root view in navigation controller

I have one navigation controller with three views. I push the three view controllers onto the navigation controller's stack and want to pop all the pushed view controllers at once by the click on a button. I would like to be able to do that from any pushed view controller...

Please can you help me and give me pointers on how I could do that?

like image 773
user564963 Avatar asked Mar 12 '11 10:03

user564963


People also ask

How do I get navigation controller root view controller?

The root view controller is simply the view controller that sits at the bottom of the navigation stack. You can access the navigation controller's array of view controllers through its viewControllers property. To access the root view controller, we ask for the first item of the array of view controllers.


1 Answers

[self.navigationController popToRootViewControllerAnimated:YES];
like image 195
Matthias Bauch Avatar answered Sep 23 '22 06:09

Matthias Bauch