Instance Method


Determines the best player in the game to act as the server for a client-server match.


- (void)chooseBestHostingPlayerWithCompletionHandler:(void (^)(GKPlayer *player))completionHandler;



A block to be called after the best player has been determined.

The block receives the following parameter:


The GKPlayer object that identifies the player with the best estimated network performance, or nil if a player could not currently be determined.


Calling this method causes Game Kit to attempt to estimate which player has the best overall network connection using a variety of metrics such as bandwidth, latency and network reliability. Typically, you call this method when your game implements a client-server model on top of the match’s peer-to-peer connection. See Game Center Programming Guide.

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

Sending Data to Other Players

- sendData:toPlayers:dataMode:error:

Transmits data to a list of connected players.

- sendDataToAllPlayers:withDataMode:error:

Transmits data to all players connected to the match.


The mechanism used to transmit data to other players.