Type Method

loadMatchWithID:withCompletionHandler:

Loads a specific match.

Declaration

+ (void)loadMatchWithID:(NSString *)matchID withCompletionHandler:(void (^)(GKTurnBasedMatch *match, NSError *error))completionHandler;

Parameters

matchID

The identifier for the turn-based match.

completionHandler

A block to be called after the match is retrieved from the server.

The block receives the following parameters:

match

If the operation completed successfully, this parameter holds the match. If an error occurred, the value is nil.

error

If an error occurred, this error object describes the error. If the operation was completed successfully, the value is nil.

Discussion

When this method is called, it creates a new background task to handle the request. The method then returns control to your game. Later, when the task is complete, Game Kit calls your completion handler. The completion handler is always called on the main thread.

See Also

Retrieving Existing Matches

+ loadMatchesWithCompletionHandler:

Loads the turn-based matches involving the local player and creates a match object for each match.