views:

51

answers:

1

Hi there,

I have an app that is built starting from a tab bar controller. It's possible for the user to bring up other screens that are loaded with:

[self.navigationController pushViewController:nextSCreen animated:YES];

The user travels several levels deep this way.

Eventually I want to be able to jump back to the original screen. I can't use:

[self.navigationController popViewControllerAnimated:TRUE];

because it only returns me one level. I haven't been able to use

[self.navigationController popToViewController:whereIStarted animated:YES];

because I'm not sure how to get the right value for whereIStarted. Remember this is a specific tab from the tab bar controller.

Does anyone have any suggestions?

Tell me if I'm unclear. Farsi is my first language.

+2  A: 

If you're trying to get back to the root controller, you can use:

[self.navigationController popToRootViewControllerAnimated:YES];
chrissr
Wow, sorry I missed that somehow.I don't suppose you know how to then change tabs?
Tristan
self.tabBarController.selectedViewController = [self.tabBarController.viewControllers objectAtIndex:3];
chrissr