我有一个导航堆栈,其中包含5个UIViewController。我想通过单击第5个ViewController中的按钮来删除堆栈中的第3个和第4个ViewController。是否有可能做到这一点?如果是怎么办? 最佳答案 使用此代码并享受:NSMutableArray*navigationArray=[[NSMutableArrayalloc]initWithArray:self.navigationController.viewControllers];//[navigationArrayremoveAllObjects];//
我有一个导航堆栈,其中包含5个UIViewController。我想通过单击第5个ViewController中的按钮来删除堆栈中的第3个和第4个ViewController。是否有可能做到这一点?如果是怎么办? 最佳答案 使用此代码并享受:NSMutableArray*navigationArray=[[NSMutableArrayalloc]initWithArray:self.navigationController.viewControllers];//[navigationArrayremoveAllObjects];//