UI: 操作导航控制器的视图控制器数组

- (void) goBack{
/* Get the current array of View Controllers */
NSArray *currentControllers = self.navigationController.viewControllers;
 /* Create a mutable array out of this array */
NSMutableArray *newControllers = [NSMutableArray arrayWithArray:currentControllers];
/* Remove the last object from the array */
[newControllers removeLastObject];
/* Assign this array to the Navigation Controller with animation */ 
[self.navigationController setViewControllers:newControllers animated:YES]; }
原文地址:https://www.cnblogs.com/safiri/p/4018574.html