Question

I'm trying to enable Game Center Leaderboard to my iPad game and I have learned that you need to post more than one score to a leaderboard for the scores to show in the default leaderboard UI.

I have two separete accounts that I used to post two different scores to the same leaderboard, but when I call loadScoresWithCompletionHandler I only get one score back (the score for the user I currently are logged in with).

Any ideas why?

GKLeaderboard *myLB = [[GKLeaderboard alloc] init];

myLB.category = @"MyLeaderboardId";
myLB.timeScope = GKLeaderboardTimeScopeAllTime;
myLB.playerScope = GKLeaderboardPlayerScopeGlobal;
myLB.range = NSMakeRange(1, 100);

[myLB loadScoresWithCompletionHandler:^(NSArray *scores, NSError *error) {
    if (error != nil)
    {
         NSLog(@"%@", [error localizedDescription]); 
    }

    if (scores != nil)
    {
        for (GKScore *score in scores)
        {
            NSLog(@"%lld", score.value);
        }
    }
}];

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top