How to make a pop back to the moreViewController?
Assume that I have an application using tabbarcontroller with 10 UIViewControllers, once the UIViewController is more than开发者_如何学JAVA 5, the Apple iPhone will generate the moreViewController for me to store rest of the UIViewController. My Question is, I want to implement a customized method to back to the more viewController, instead of using the default back in the left corner. How can I do so?
I tried with
[moreNavigationController popToRootViewControllerAnimated:NO];
but it seems that I have no luck. Thank you.
You can create an array of ViewControllers and then pop to the view Controller you need.
You can try this block of code
-(IBAction)home:(id)sender{
NSArray *array = self.navigationController.viewControllers;
[self.navigationController popToViewController:[array objectAtIndex:1] animated:YES];
}
Cheers
[self.navigationController popToRootViewControllerAnimated:YES]
精彩评论