November 2011
Beginner
238 pages
6h 19m
English
If you want to bypass the GKTurnBasedMatchmakerViewController and implement your own GUI, there is an option to do so. Using the following method will create a new match without having the user go through the matchmaker.
- (void)findMatch
{
GKMatchRequest *match = [[GKMatchRequest alloc] init];
[match setMaxPlayers:2];
[match setMinPlayers:2];
[GKTurnBasedMatch findMatchForRequest:match withCompletionHandler:^(GKTurnBasedMatch
*match, NSError *error) {
if (error == nil) {
//start new game with returned match
} else {
NSLog(@"An error occurred when finding a match: %@", [error
localizedDescription]);
}
}];
}
In addition to creating a game, you need to be ...