2012-06-15 73 views
5

我有一個名爲currentMatch的GKTurnBasedMatch,我想知道如何獲取在當前正在播放的播放器之後播放的播放器的名稱。獲取播放器別名

謝謝!

回答

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 
} 


}]; 
相關問題