目前我的情况是这样的,
View Controller(VC1) --> Push Segue --> View Controller(VC2)
| ^
| Model Segue |
| | Push Segue
|-----> View Controller(VC3) ------|
现在VC3
当我推进VC2
时,我想解雇VC3
查看控制器和
在VC2
后退按钮之后它应该是VC1's
后视图控制器我想要弹出VC3
我想要的是当我从VC3推VC2时我想删除VC3当我们回来它VC1应该出现
我这样做过,任何人都可以帮助我
查看控制器(VC3):
- (void)callWebservice {
[self dismissViewControllerAnimated:YES completion:^{
[self performSegueWithIdentifier:@"showVC2" sender:self];
}];
}
提前致谢
答案 0 :(得分:0)
我认为您正在寻找https://stackoverflow.com/a/21415225/1320305如果您正在使用segue,请手动尝试以下操作:
你可以试试这个
// locally store the navigation controller since
// self.navigationController will be nil once we are popped
UINavigationController *navController = self.navigationController;
// retain ourselves so that the controller will still exist once it's popped off
[[self retain] autorelease];
// Pop this controller and replace with another
[navController popViewControllerAnimated:NO];//not to see pop
[navController pushViewController:aViewController animated:YES];
//to see push or u can change it to not to see.
或试试这个
UIViewController *newVC = [[UIViewController alloc] init]; // Replace the current view controller
NSMutableArray *viewControllers = [NSMutableArray arrayWithArray:[[self navigationController] viewControllers]];
[viewControllers removeLastObject];
[viewControllers addObject:newVC];
[[self navigationController] setViewControllers:viewControllers animated:YES];
答案 1 :(得分:0)
我认为你可以这样实现:
您可以看到我的演示文稿:Demo Pushview Swift