Ward
Ward

Reputation: 3318

iPhone - Reset UINavigation Controller

I have a UINavigationController inside a UITabBarController. When a user presses the first tab, I want to reset the navigation controller back to the first screen instead of displaying whichever view they last selected in the navigation controller. Is there an easy way to reset the stack?

Thanks, Howie

Upvotes: 1

Views: 522

Answers (2)

Piotr Czapla
Piotr Czapla

Reputation: 26532

Check this thread: http://www.iphonedevsdk.com/forum/iphone-sdk-development/2625-uinavigationcontroller-uitabbarcontroller.html

According to this thread you should reset the navigation controller in – tabBarController:didSelectViewController:

Upvotes: 1

Ben Gottlieb
Ben Gottlieb

Reputation: 85532

-[UINavigationController popToRootViewControllerAnimated:] should do what you want.

Upvotes: 2

Related Questions