我需要使用 performSegueWithIdentifier
转到另一个 View Controller ,但我还需要删除我当前所在的 View Controller 。我该怎么做,我试过这个但它不起作用:
[self performSegueWithIdentifier:@"next" sender:self];
[self dismissViewControllerAnimated:NO completion:nil];
//tried the other way, but it doesn't work either
[self dismissViewControllerAnimated:NO completion:nil];
[self performSegueWithIdentifier:@"next" sender:self];
看起来没有任何简单的方法可以做到这一点? 我有 4 个 View Controller ,它们是这样连接的,我想从游戏结束到高分。
menu-->game----->gameover
menu-->highscore
最佳答案
这个怎么样?
UIViewController *parentController = self.presentingViewController;
[picker dismissViewControllerAnimated:YES completion:^(void){
[parentController performSegueWithIdentifier:@"next" sender:self];
}];
关于objective-c - 关闭 Viewcontroller 并执行 segue,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13733263/