例如,导航控制器中的当前视图控制器是“A”。现在在'A'导航到'B'之前或之后,我想要杀掉'A'。这种机制有办法吗?
答案 0 :(得分:1)
当然,做这样的事情:
NSMutableArray *vcArray = [[NSMutableArray alloc] initWithArray: self.navigationController.viewControllers];
[vcArray removeObjectAtIndex: 0];
self.navigationController.viewControllers = vcArray;
// don't forget to release vcArray if you aren't using ARC