我正在尝试为我的游戏设置一个排行榜,但我不知道如何传递给GKScore:initWithCategory。在Itunes Connect中有“排行榜参考名称”和“排行榜ID”,这两个我都试过了,但分数现在仍然显示在gamecenter中。
在ITC中没有提到“类别”,术语有变化吗?我应该把什么传递给这个函数?
发布于 2012-03-14 05:14:06
您需要传递的值在连接排行榜部分中标记为iTunes排行榜ID。
更新:我使用以下内容向排行榜提交高分,其中类别是在iTunes连接中指定的LeaderBoard ID
GKScore *scoreReporter = [[[GKScore alloc] initWithCategory:@"yourLeaderBoardId"] autorelease];
scoreReporter.value = score;
[scoreReporter reportScoreWithCompletionHandler:^(NSError *error)
{
if (error != nil)
{
// handle the reporting error
NSLog(@"error reporting score");
}
}];此外,似乎在沙箱中,除非两个或更多不同的GameCenter帐户提交了分数,否则不会显示分数。
https://stackoverflow.com/questions/9692115
复制相似问题