我有一个名为 currentMatch 的 GKTurnBasedMatch,我想知道如何在当前正在玩的玩家之后获取正在玩的玩家的名字。
谢谢!
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
}
}];