A-(push)-B-(push)-C,C-(pop)-D-(pop)-A
NSMutableArray *vcArrs = [self.navigationController.viewControllers mutableCopy];
index = 1;
[viewControllers replaceObjectAtIndex:index withObject:B];
[self.navigationController setViewControllers: vcArrs];
A-(push)-B-(push)-C-(push)-D,D-(pop)-B
C的代码
index = 1;
[vcArrs removeObjectsInRange:NSMakeRange(index+1, viewControllers.count-index-2)];
[self.navigationController setViewControllers: vcArrs];
以此类推
就这样吧……
网友评论