ios - 在模拟器上向 Game Center 添加分数,而不是在设备上

标签 ios xcode ios4 game-center

我正在将 Game Center 功能添加到我的应用程序中。在模拟器上,该应用程序从游戏中心应用程序和我的应用程序中的排行榜 View 中完美地注册和加载高分。当我在实际设备上尝试同样的操作时,控制台显示分数已提交,但分数没有显示在 Game Center 应用程序或我应用程序的排行榜 View 中。不知道为什么会这样。任何帮助都会很棒。这是我如何实现它的代码。

我的 View 已加载

[[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error){
        if (error ==nil) {
            NSLog(@"Success");
        } else {
            NSLog(@"Fail");
        }

    }];

我如何提交分数

-(IBAction)submitMyScore{
    //This is the same category id you set in your itunes connect GameCenter LeaderBoard
    GKScore *myScoreValue = [[[GKScore alloc] initWithCategory:@"01"] autorelease];
    myScoreValue.value = score;

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

    }];
}

有人知道这是为什么吗?

最佳答案

我解决了这个问题。我注销了我的游戏中心帐户,然后开始游戏。它提示我创建一个新的游戏中心帐户,我做到了。然后它让我进入沙盒模式并允许我查看和发布分数。

关于ios - 在模拟器上向 Game Center 添加分数,而不是在设备上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6480448/

相关文章:

ios - 为什么 [RACLifting rac_liftSelector :] print different results between case A and B

ios - 在 Swift 中使用 Unicode 代码点

ios - 在iOS中制作菜单来自左角

iphone - 隐藏或移动SegmentContoller

iphone - iOS 4.0/4.2 如何获取当前位置的经纬度?

ios - 核心数据中最后一行 id 始终返回零

html - Bootstrap 下拉菜单不适用于 iOS

ios - 从 HealthKit 获取一系列血糖记录

xcode - React Native XCode 项目在不改变任何东西的情况下重建

ios - 当应用程序转到后台时,SwiftUI View 停止更新