我有一个名为currentMatch的GKTurnBasedMatch,我想知道如何获得在当前正在玩的玩家之后玩的玩家的名字。
谢谢!
答案 0 :(得分:14)
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
}
}];