Instance Method

setConnectionState:completionHandler:

Sets the connection state for the player.

Declaration

- (void)setConnectionState:(GKConnectionState)state completionHandler:(void (^)(NSError *error))completionHandler;

Parameters

state

The GKConnectionState to be assigned to the player.

completionHandler

A block that is called after the connect state has been set.

error

If an error occurred, this parameter holds an error object that explains the error. Otherwise, the value of this parameter is nil. See GameKit Constants for a list of error codes specific to GameKit.

Discussion

This method will fail when the game session's player limit has already been reached or there are network problems. The game session's lastModifiedDate and lastModifiedPlayer properties are updated on completion.

See Also

Connecting Players for Real-Time Communication

- playersWithConnectionState:

Retrieves a list of players with the specified connection state.

Deprecated
- sendData:withTransportType:completionHandler:

Sends the indicated data to all connected players.

Deprecated
GKTransportType

The mechanism used to send messages to other players in a game session.