i want to go from any sub view to main view directly on a single button click but not pressing back again and again
A:
You could use the following UINavigationController method when the back button is tapped:
- (NSArray *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated
Run Loop
2010-07-24 09:25:58
+1
A:
I guess you are looking for this:
[self.navigationController popToRootViewControllerAnimated:YES];
That will pop all view controllers down to the root. If the main menu is not your root view controller then you can use this:
[self.navigationController popToViewController:mainMenuVC animated:YES];
In this case you need to have a "pointer" to the mainMenuVC available. You can do that by setting a property in the App Delegate.
Hope it helps!
gonso
2010-07-24 09:29:10