Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.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
Iphone 游戏中心分数发布/排行榜创建不是';行不通_Iphone_Xcode_Game Center - Fatal编程技术网

Iphone 游戏中心分数发布/排行榜创建不是';行不通

Iphone 游戏中心分数发布/排行榜创建不是';行不通,iphone,xcode,game-center,Iphone,Xcode,Game Center,我想让游戏中心和我一起工作,运气不好。我使用的是苹果的示例代码。 当我在应用程序中查看排行榜时,我在game center的排行榜下看到“无法加载” 我检查过的东西: ITunesConnect上的捆绑包ID与我的info.plist中的相同 我的排行榜是在iTunesconnect上建立的 我的排行榜ID已正确输入代码 #导入包含在.m文件中 我在.h文件中的代码: int *scoreInt; } -(IBAction)subScore; -(IBAction)showLe

我想让游戏中心和我一起工作,运气不好。我使用的是苹果的示例代码。 当我在应用程序中查看排行榜时,我在game center的排行榜下看到“无法加载”

我检查过的东西:

  • ITunesConnect上的捆绑包ID与我的info.plist中的相同
  • 我的排行榜是在iTunesconnect上建立的
  • 我的排行榜ID已正确输入代码
  • #导入包含在.m文件中
我在.h文件中的代码:

    int *scoreInt;


}

-(IBAction)subScore;
-(IBAction)showLeader;
my.m文件中的代码:

-(IBAction)subScore
{
    {
        GKScore *scoreReporter = [[[GKScore alloc] initWithCategory:@"1234567"] autorelease];
        //in his tuturial value = scoreInt, not a label.

        //try either i_StartPt or finalStarPt
        scoreReporter.value = scoreInt;

        [scoreReporter reportScoreWithCompletionHandler:^(NSError *error) {
            if (error != nil)
            {
                NSLog(@"failed!!!");
                NSLog(scoreInt);
            }
        }];
    }
}
-(IBAction)showLeader
{
    GKLeaderboardViewController *leaderboardController = [[GKLeaderboardViewController alloc] init];
    if (leaderboardController != nil)
    {
        leaderboardController.leaderboardDelegate = self;
        [self presentModalViewController: leaderboardController animated: YES];
    }
}

- (void)leaderboardViewControllerDidFinish:(GKLeaderboardViewController *)viewController
{
    [self dismissModalViewControllerAnimated:YES];
}
任何建议都太棒了!我看过stackoverflow上的类似错误,但还没有找到有效的解决方案


克里斯

你签了本地球员了吗

还要检查以确保您已根据进行了所有设置