陈斌彬的技术博客

Stay foolish,stay hungry

iOS调整ViewController的序列

 NSArray *currentControllers = self.navigationController.viewControllers;//获得视图控制器堆栈数组 
    NSMutableArray *newControllers = [NSMutableArray arrayWithArray:currentControllers];//基于堆栈数组实例化新的数组 
    [newControllers removeLastObject];//移除堆栈顶端数组 
//    self.navigationController.viewControllers = newControllers;//为堆栈重新赋值 
    [self.navigationController setViewControllers:newControllers animated:YES];//为堆栈重新赋值