2012-06-15 15 views
5

Ho un GKTurnBasedMatch denominato currentMatch e vorrei sapere come ottenere il nome del giocatore che suona dopo il giocatore che sta giocando.Come alias del player

Grazie!

risposta

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 
} 


}];