Adding a Player to a Match

There might be occasions in which you will want to add a new player to a match after it has already been created. For example, maybe you have a player drop from a game and want to replace him without starting the game over, or a player fails to connect after a game starts and you want to substitute in a replacement. The following method will automatically add a new player to the match using the auto-matching behavior.

- (void)addPlayerToMatch:(GKMatch *)match withRequest:(GKMatchRequest *)request {         [[GKMatchmaker sharedMatchmaker] addPlayersToMatch:match matchRequest:requestimage  completionHandler:^(NSError *error) ...

Get Beginning iOS Game Center and Game Kit: For iPhone, iPad, and iPod touch now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.