Getting a player alias

I have a GKTurnBasedMatch named currentMatch, and I would like to know how to get the name of the player who is playing after the player who is currently playing.

Thank!

+5
source share
1 answer
NSMutableArray *playerIDs = [NSMutableArray arrayWithCapacity:match.participants.count];
for (GKTurnBasedParticipant *part in match.participants) {
    if([part.playerID isKindOfClass:[NSString class]]){
        [playerIDs addObject:part.playerID];
    }
}


[GKPlayer loadPlayersForIdentifiers:playerIDs withCompletionHandler:^(NSArray *players, NSError *error) {
    for (GKPlayer *player in players) {

       //get the aliases
}


}];
+14
source

All Articles