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

时间:2014-10-11 14:07:15   收藏:0   阅读:115
- (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]; }

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!