popToViewController is method in UINavigationController class that is part of iOS SDK. By calling this method you pop view controllers until the specified view controller is at the top of the navigation stack.
The definition of method is next:
- (NSArray *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated;
Parameters
viewController
: The view controller that you want to be at the top of the stack.animated
: Set this value to YES to animate the transition. Pass NO if you are setting up a navigation controller before its view is displayed.
Return Value
An array containing the view controllers that were popped from the stack.