Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 排行榜分数未显示在游戏中心中_Objective C_Ios7_Xcode5_Game Center - Fatal编程技术网

Objective c 排行榜分数未显示在游戏中心中

Objective c 排行榜分数未显示在游戏中心中,objective-c,ios7,xcode5,game-center,Objective C,Ios7,Xcode5,Game Center,我已经为我的应用创建了一个排行榜。它显示在游戏中心,但分数从未提交 我提交了一份带有以下代码的测试分数: GKScore* gkScore; // Set the score value gkScore.value = gameTimer; // Send the score to Game Center [gkScore reportScoreWithCompletionHandler:^(NSError* error) {}]; 这是我用来提交适合我的分数的函数 - (void) re

我已经为我的应用创建了一个排行榜。它显示在游戏中心,但分数从未提交

我提交了一份带有以下代码的测试分数:

GKScore* gkScore;

// Set the score value
gkScore.value = gameTimer;

// Send the score to Game Center
[gkScore reportScoreWithCompletionHandler:^(NSError* error) {}];

这是我用来提交适合我的分数的函数

- (void) reportScore: (int64_t) reportScore forLeaderboardID: (NSString*) identifier
{
    GKScore *scoreReporter = [[GKScore alloc] initWithLeaderboardIdentifier: identifier];
    scoreReporter.value = reportScore;
    scoreReporter.context = 0;

    NSArray *scores = @[scoreReporter];
    [GKScore reportScores:scores withCompletionHandler:nil];

}
此外,请确保您的排行榜是实时的或添加到新版本提交中。itunesConnect>你的应用程序>查看新版本的详细信息>游戏中心添加新排行榜(如果尚未添加)