ios - 排行榜分数未显示 UP

标签 ios xcode leaderboard

我创建了一个小应用程序只是为了测试游戏中心,我登录后可以提高分数,但当我查看排行榜时什么也没有

这是我的代码

- (IBAction)increaseScore:(id)sender {

currentScore+=4;
scoreLabel.text=[NSString stringWithFormat:@"%i",currentScore];
}

- (IBAction)showLeaderBoard:(id)sender {

GKLeaderboardViewController *leaderBoardController = [[GKLeaderboardViewController    alloc]init];
leaderBoardController.category=@"1";
leaderBoardController.timeScope=GKLeaderboardTimeScopeAllTime;
leaderBoardController.leaderboardDelegate=self;

[self presentModalViewController:leaderBoardController animated:YES];

}
- (void)leaderboardViewControllerDidFinish:(GKLeaderboardViewController *)viewController
{
[self dismissModalViewControllerAnimated:YES];

}


- (IBAction)sumbitScore:(id)sender {

GKScore *scoreReporter = [[GKScore alloc]initWithCategory:@"1"];
//@"1" is the leaderboard ID
scoreReporter.value=currentScore;
[scoreReporter reportScoreWithCompletionHandler:^(NSError *error) {
    if (error) {
        NSLog(@"submit failed");
    }else{

        NSLog(@"access granted");

    }

}];

}

最佳答案

只有当排行榜上有两个或更多玩家时,GameCenter 才会显示排行榜分数。

您将需要另一个 GameCenter 帐户提交的分数。您可以注册第二个 Apple ID,以便能够发送“第二个”玩家的分数。

关于ios - 排行榜分数未显示 UP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8303215/

相关文章:

ios - ios8中的UIWebView透明背景

ios - UIWindow addSubview 在 iOS 9 中不起作用

iphone - iTunesConnect GameCenter LeaderBoard 新功能移至群组

iphone - iOS 异步 NSURLConnection 在与调用它的 View 不同的 View 上触发行为

ios - NSUserDefault 在后退按钮上快速同步

ios - MVC 中应用了哪些 OOP 概念?

php - 创建 MySQL 排行榜

iOS swift : UIPanGestureRecognizer on 2 differents views

ios - 线程 1 : EXC_BAD_ACCESS when accessing custom view attribute

android - 当应用程序在 Play 商店发布时,Google LeaderBoard 不工作