O'Reilly logo

Beginning iOS Game Center and Game Kit: For iPhone, iPad, and iPod touch by Kyle Richter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Mapping a Player ID

In the previous section, we learned how to pull down the raw score values of a leaderboard. However, we ended up with a leaderboard that contained only player IDs rather than the aliases (which the user expects to be shown). In this section, we will create a new method that will translate player IDs into player aliases. We will begin this process by adding some new methods to our GameCenterManager class. These will enable searching for a single name and an array of names. Add the following two methods to the GameCenterManager class.

- (void)mapPlayerIDtoPlayer:(NSString*)playerID {         [GKPlayer loadPlayersForIdentifiers: [NSArray arrayWithObject: playerID]                             withCompletionHandler:^(NSArray *playerArray, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required