Q:

Show another ViewController

help me please. How can I show another view controller after dismissing the existing one? here is my code: 
- (void)matchmakerViewControllerWasCancelled:
(GKMatchmakerViewController *)viewController{

    [self dismissModalViewControllerAnimated:YES];

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

}

My code doesn't work. Help me please. If i wrote NSLog after dismissingModalViewController, it shows me that NSLog, but ViewController won't show. thanks

A:

[self dismissModalViewControllerAnimated:YES]; has been deprecated. Try doing:
- (void)matchmakerViewControllerWasCancelled:
(GKMatchmakerViewController *)viewController{

    [self dismissViewControllerAnimated:YES completion:^{
         ViewController *Vc = [[ViewController alloc]init];
         [self presentViewController:Vc animated:YES completion:^{}];
    }];
}

