无法在iOS 7上加载最高排行榜评分

我有一个函数来从我的iOS游戏的排行榜中加载最高分,它在iOS 6中工作,但它不再在iOS 7中工作。我使用的函数如下:

- (void) retrieveGlobalHighScore { if(userAuthenticated == true) { //NSLog(@"Attempting to retrieve global high score..."); GKLeaderboard *leaderboardRequest = [[GKLeaderboard alloc] init]; if (leaderboardRequest != nil) { leaderboardRequest.playerScope = GKLeaderboardPlayerScopeGlobal; leaderboardRequest.timeScope = GKLeaderboardTimeScopeAllTime; leaderboardRequest.range = NSMakeRange(1,1); [leaderboardRequest loadScoresWithCompletionHandler: ^(NSArray *scores, NSError *error) { if (error != nil) { // handle the error. if (scores != nil) NSLog(@"ERROR: Issue loading global high score."); NSLog(@"Unresolved error %@", error); } if (scores != nil){ // process the score information. globalHighScoreReturn = ((GKScore*)[scores objectAtIndex:0]).value; } }]; } } else { //NSLog(@"User is not authenticated. Global high score not loaded."); } } 

我现在得到以下错误,不能找出如何解决它:

 Error Domain=GKErrorDomain Code=17 "The requested operations could not be completed because one or more parameters are invalid." UserInfo=0xf539250 {GKServerStatusCode=5053, NSUnderlyingError=0xf538670 "The operation couldn't be completed. status = 5053, asking for legacy aggregate leaderboard on a game with no legacy aggregate leaderboard", NSLocalizedDescription=The requested operations could not be completed because one or more parameters are invalid.} 

任何帮助将不胜感激!

这是我不得不补充解决这个问题(iOS 7):

  leaderboardRequest.identifier = @"my_leaderboardID"; 

我发现这个问题。 在iOS 6中,不需要设置leaderboardRequest.category,并且默认排行榜(我只使用1)被自动选中。 在iOS 7中,必须指定类别。 指定标识符的工作,但是我支持iOS 6和7。