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]; }

 

posted @ 2014-10-11 11:04  safiri  阅读(116)  评论(0编辑  收藏  举报