1

我调用下面的代码在屏幕顶部添加 Game Center 用户横幅弹出,但它显示 Game 无法被 Game Center 识别:

我将此添加到我的 addDidFinishLaunching 中:

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

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

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

1 回答 1

1

你可以这样尝试:

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

我希望它有帮助:-)

于 2012-05-03T00:40:52.270 回答