iOS游戏中心沙盒:排行榜显示“无分数” [英] iOS Game Center Sandbox: Leaderboards show "No score"

查看:143
本文介绍了iOS游戏中心沙盒:排行榜显示“无分数”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我将分数发送到GC排行榜,我没有收到任何错误,分数显着发送但我仍然看不到排行榜中列出的分数!排行榜本身列在游戏中心,没有得分。

So I am sending scores to the GC leaderboards, I receive no errors and the scores apprently send but I still see no scores listed in the leaderboards! The leaderboard itself is listed in Game Center there are just no scores.

根据谷歌搜索和这里的问题这可以通过尝试使用多个帐户记录分数来解决。我现在已经在Simulator(iOS5)和iPhone上尝试了三个不同的帐户;提交分数时,没有一个显示任何错误。

According to a Google search and a question on here this could be resolved by attempting to log scores with more than one account. I have tried on three different accounts now both in Simulator (iOS5) and on my iPhone; none of them show any errors when submitting the scores.

发送分数的代码在这里:

The code that sends the score is here:

- (void)reportScore:(NSString *)identifier score:(int)rawScore {

    GKScore *score = [[[GKScore alloc] initWithCategory:identifier] autorelease];
    score.value = rawScore;
    [scoresToReport addObject:score];
    [self save]; // Save here even though we save again in didEnterBackground, just in case of crash...

    if (!gameCenterAvailable || !userAuthenticated) return;
    [self sendScore:score];
}

- (void)sendScore:(GKScore *)score {
    [score reportScoreWithCompletionHandler:^(NSError *error) {
        dispatch_async(dispatch_get_main_queue(), ^(void)
                       {
                           if (error == NULL) {
                               NSLog(@"Successfully sent score!");
                               [scoresToReport removeObject:score];                
                           } else {
                               NSLog(@"Score failed to send... will try again later.  Reason: %@", error.localizedDescription);                
                           }
                       });
    }];
}


推荐答案

它突然开始工作(没有任何代码更改甚至重新编译)。我认为排行榜实际出现需要一段时间,对我来说大约需要18个小时。

It suddenly started working (without any code change or even a recompile). I figure it takes a while for the leaderboards to actually appear, for me about 18 hours.

在这段时间内提交的分数仍会记录,它们只是不会立即显示。

Scores submitted within this time will still record, they just wont be visible instantly.

这篇关于iOS游戏中心沙盒:排行榜显示“无分数”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆