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