[IOS SDK] retrieving scores from game center
- by Sam
I got this code from apple's developer site. How do i process the score information to be viewed in a like a UITableView or something?
(void) retrieveTopTenScores
{
GKLeaderboard *leaderboardRequest = [[GKLeaderboard alloc] init];
if (leaderboardRequest != nil)
{
leaderboardRequest.playerScope = GKLeaderboardPlayerScopeGlobal;
leaderboardRequest.timeScope = GKLeaderboardTimeScopeAllTime;
leaderboardRequest.range = NSMakeRange(1,10);
[leaderboardRequest loadScoresWithCompletionHandler: ^(NSArray *scores, NSError *error) {
if (error != nil)
{
// handle the error.
}
if (scores != nil)
{
// process the score information.
}
}];
}
}