1

お願い助けて。既存のView Controllerを閉じた後、別のView Controllerを表示するにはどうすればよいですか? ここに私のコードがあります:

- (void)matchmakerViewControllerWasCancelled:
(GKMatchmakerViewController *)viewController{

    [self dismissModalViewControllerAnimated:YES];

   ViewController *Vc = [[ViewController alloc]init];
    [self presentModalViewController:Vc animated:YES];



}

コードが機能しません。お願い助けて。ModalViewControllerを閉じた後にNSLogを書いた場合、NSLogが表示されますが、ViewControllerは表示されません。ありがとう

4

2 に答える 2

4

[self dismissModalViewControllerAnimated:YES];廃止されました。やってみてください:

- (void)matchmakerViewControllerWasCancelled:
(GKMatchmakerViewController *)viewController{

    [self dismissViewControllerAnimated:YES completion:^{
         ViewController *Vc = [[ViewController alloc]init];
         [self presentViewController:Vc animated:YES completion:^{}];
    }];
}
于 2012-11-14T19:07:43.633 に答える
0

これをチェックするだけです

[self dismissModalViewControllerAnimated:NO];
Nextview *sec = [[Nextview alloc] initWithNibName:@"Nextview" bundle:nil];
[self presentModalViewController:sec animated:YES];
[sec release];

これがうまくいくことを願っています。

于 2012-11-14T19:07:56.617 に答える