在解散一個ViewController之後怎麼顯示另一個ViewController?
我的代碼沒實現,不知道在哪兒有錯誤
- (void)matchmakerViewControllerWasCancelled:
(GKMatchmakerViewController *)viewController{
[self dismissModalViewControllerAnimated:YES];
ViewController *Vc = [[ViewController alloc]init];
[self presentModalViewController:Vc animated:YES];
}
如果在ModalViewController之後寫NSLog,就會顯示NSLog ,但是沒有顯示ViewController
[self dismissModalViewControllerAnimated:YES];
這句有問題;
試試這個:
- (void)matchmakerViewControllerWasCancelled:
(GKMatchmakerViewController *)viewController{
[self dismissViewControllerAnimated:YES completion:^{
ViewController *Vc = [[ViewController alloc]init];
[self presentViewController:Vc animated:YES completion:^{}];
}];
}