2012-05-02 45 views
1

我叫下面的代码添加游戏中心的用户的横幅在屏幕上方弹出,但它说游戏不被游戏中心确认:GameCenter整合并发症?

我将此添加到我的addDidFinishLaunching:

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

要查看排行榜,需要添加哪些代码才能正确调用它?

-(void)viewscores:(SPEvent*)event{ 
CODE HERE 
} 
+0

你尝试苹果的游戏中心的文档?我相信他们有相当多的示例代码在那里为这些工作流程... – fbrereto

+0

我已阅读所有Apple Game Center文档,仍然无法修复。当我在设备上运行游戏时,它说:这个游戏不被Game Center识别。但在模拟器上,它加载了横幅并说SandBox。 – Raoul

+0

我想我已经明白了,但是你知道代码是用于查看排行榜吗? – Raoul

回答

1

你可以尝试这样的:

GKLeaderboardViewController *leaderboardVC = [[[GKLeaderboardViewController alloc]init]autorelease]; 
if (leaderboardVC !=nil) { 
    leaderboardVC.leaderboardDelegate = self; 
    [self presentViewController:leaderboardVC]; 
} 

我希望它能帮助:-)