OGeek|极客世界-中国程序员成长平台

标题: iphone - Game Center 未在排行榜 iPhone 中显示分数 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 10:30
标题: iphone - Game Center 未在排行榜 iPhone 中显示分数

我已经在我的项目中集成了游戏中心,我可以登录游戏中心并可以打开排行榜但它没有显示任何分数。我试图在排行榜中提交分数,它返回成功,但它没有显示在那里。

提交分数

-(void)submitScore
{
    GKScore *myScoreValue = [[[GKScore alloc] initWithCategory"something"] autorelease];
    myScoreValue.value = [prefs integerForKey"total"];

    [myScoreValue reportScoreWithCompletionHandler:^(NSError *error){
        if(error != nil){
            NSLog(@"Score Submission Failed");
        } else {
            NSLog(@"Score Submitted");
        } 
    }];
}

我已经搜索过这个问题,我发现 thisthis 我都试过了,但都不行。

我在启动应用程序时得到这个。

<Info>: 16:39:10.550238 com.apple.AVConference: GKSConnSettings: set server: {
    "gk-cdx" = "17.173.254.218:4398";
    "gk-commnat-cohort" = "17.173.254.220:16386";
    "gk-commnat-main0" = "17.173.254.219:16384";
    "gk-commnat-main1" = "17.173.254.219:16385";
}

我的代码有什么问题吗?



Best Answer-推荐答案


给你的一些笔记

« Make sure leaderboard is setup in iTunesConnect with Id: something

« Login gamecenter app with testUser from same iTunesConnect account

« Try myScoreValue.value = 500 once, sometimes small values are neglected in sandbox mode.

« Confirm - Logged in to sandbox mode

enter image description here

关于iphone - Game Center 未在排行榜 iPhone 中显示分数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16014233/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4