Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting player alias

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

Thanks!

like image 913
Lior Pollak Avatar asked Jun 15 '12 15:06

Lior Pollak


1 Answers

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
}


}];
like image 162
Kaan Dedeoglu Avatar answered Sep 17 '22 12:09

Kaan Dedeoglu