2012-06-15 31 views
5

मेरे पास वर्तमान मैच नामक एक 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 
} 


}];