Instance Method

declineInviteWithCompletionHandler:

Programmatically decline an invitation to a turn-based match.

Declaration

- (void)declineInviteWithCompletionHandler:(void (^)(NSError *error))completionHandler;

Parameters

completionHandler

A block to be called after the match is successfully created.

The block receives the following parameter:

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

Creating a New Match

+ findMatchForRequest:withCompletionHandler:

Programmatically searches for a new match to join.

- acceptInviteWithCompletionHandler:

Programmatically accept an invitation to a turn-based match.

- rematchWithCompletionHandler:

Create a new turn-based match with the same participants as an existing match.