Iphone 游戏中心分数发布/排行榜创建不是';行不通
我想让游戏中心和我一起工作,运气不好。我使用的是苹果的示例代码。 当我在应用程序中查看排行榜时,我在game center的排行榜下看到“无法加载” 我检查过的东西: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
- ITunesConnect上的捆绑包ID与我的info.plist中的相同
- 我的排行榜是在iTunesconnect上建立的
- 我的排行榜ID已正确输入代码
- #导入包含在.m文件中
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上的类似错误,但还没有找到有效的解决方案
克里斯你签了本地球员了吗 还要检查以确保您已根据进行了所有设置