我创建了一个小应用程序只是为了测试游戏中心我登录我可以提高分数但是当我查看排行榜时什么都没有
这是我的代码
- (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");
}
}];
}