Pintu
Pintu

Reputation: 369

Navigation back to main view

I have a root view controller as the navigation controller. In the root view controller nib file I have 3 buttons (button 1, button 2, button3). Each of which has a table view contoller Eg: Flow of the buttons (I have followed the navigation logic such that at any time I can get back to the root view controller by selecting the back button).

On Button 1 click => table view shown ==> detail view shown on item click/selection

On Button 2 click => table view shown ==> detail view shown on item click/selection

This logic holds good for all the buttons. In the detail view I have a button.

What I want is on the click of this button, the button 3 logic should be called such that, when i click or press the back button from the table view of 3rd button, I should get back to the main root view controller with all the buttons visible.

Please let me know how should i go ahead with the same.

Upvotes: 0

Views: 418

Answers (1)

Reed Olsen
Reed Olsen

Reputation: 9169

I believe you'll want to use the - (NSArray *)popToRootViewControllerAnimated:(BOOL)animated found in UINavigationController. As the name suggests, this will allow you to pop back to the root view controller at any time.

Upvotes: 4

Related Questions