我调用下面的代码在屏幕顶部弹出游戏中心用户横幅,但它说游戏中心无法识别游戏:
我将此添加到我的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 :(得分:1)
你可以这样试试:
GKLeaderboardViewController *leaderboardVC = [[[GKLeaderboardViewController alloc]init]autorelease];
if (leaderboardVC !=nil) {
leaderboardVC.leaderboardDelegate = self;
[self presentViewController:leaderboardVC];
}
我希望它有所帮助: - )