November 2011
Beginner
238 pages
6h 19m
English
Starting a new match with turned-based gaming is a very straightforward and simple process. To do so, you need to implement the following method. This new method dismisses the GKTurnBasedMatchmakerViewController, and then passes a copy of the match object to your game controller. The following code snippet is the procedure we follow for tic-tac-toe.
- (void)turnBasedMatchmakerViewController:(GKTurnBasedMatchmakerViewController
*)viewController didFindMatch:(GKTurnBasedMatch *)match
{
[self dismissModalViewControllerAnimated: YES];
tictactoeGameViewController *gameVC = [[tictactoeGameViewController alloc] init];
gameVC.match = match;
[[self navigationController] pushViewController:gameVC animated:YES]; [gameVC ...