我通过以下教程创建了新的排行榜(我的第一个排行榜)
初始化或报告分数时我没有错误。我已经成功提交了 5 到 10 个不同设备的不同分数。问题是我无法在 GameCenter 应用程序中看到排行榜选项卡,并且自实施排行榜以来的 10 天新。
我已经与其他教程和开发人员多次交叉验证了我的实现。请帮我解决这个问题。
提交分数的代码:-
- (void) submitScore : (int)_score {
if (!_gameCenterFeaturesEnabled) {
NSLog(@"Player not authenticated");
return;
}
GKScore* gkScore = [[GKScore alloc] initWithLeaderboardIdentifier: GC_LEADERBOARD_ID];
gkScore.value = _score;
[GKScore reportScores: @[gkScore] withCompletionHandler: ^(NSError* error) {
NSLog(@"Error Reporting Score to Leaderboard %@", error);
NSLog(@"GKScore %@", gkScore);
if (error == nil) {
if ([_delegate respondsToSelector: @selector(onScoresSubmitted:)]) {
[_delegate onScoresSubmitted: YES];
}
}
else {
[self setLastError:error];
}
}];
}
显示排行榜的代码:-
-(void)showLeaderboard {
GKGameCenterViewController *gcViewController = [[GKGameCenterViewController alloc] init];
gcViewController.gameCenterDelegate = self;
gcViewController.viewState = GKGameCenterViewControllerStateLeaderboards;
gcViewController.leaderboardIdentifier = GC_LEADERBOARD_ID;
[self presentViewController: gcViewController animated:YES forDisplay: self.view];
}