Take the 2-minute tour ×

I've a sequence of UIViewControllers pushed by a NavigationController.

What's the best way to come back to the home ViewController without having to go back through all chain of UIViewControllers ?


share|improve this question
add comment

1 Answer

up vote 1 down vote accepted
    [self.navigationController popToRootViewControllerAnimated:(BOOL)]
share|improve this answer
Thanks. One more question: what if the controller I'm interested in is not actually in the navigationController stack. Should I remove all of them and add a new one ? –  Patrick Aug 23 '11 at 16:02
How is it 'connected' the navigationController stack? Obviously the method I posted will move to the first view on the stack. –  BlueMeanie Aug 23 '11 at 17:21
1) It is the second one. ( 2) Also, what if I need to load a new navigationController which is not on the stack ? How can I get rid of the stack and just load such controller ?) –  Patrick Aug 24 '11 at 8:26
@Patrick - Please read the fine manuals. See "Pushing and Popping Stack Items" in Apple's UINavigationController class reference. When you bother to look up BlueMeanie's suggested method, you'll find others. –  Basil Bourque Nov 19 '12 at 2:57
add comment

Your Answer


