目标:当他/她在ios 7设备上点击应用中的排行榜按钮时,向本地用户显示默认排行榜。
[[GKLocalPlayer localPlayer] loadDefaultLeaderboardIdentifierWithCompletionHandler:(void(^)(NSString *leaderboardIdentifier, NSError *error)) {
//Use the leaderboard identifier.
MyLeaderBoardID
}]
答案 0 :(得分:0)
将UIButton链接到以下方法以显示默认排行榜:
- (void) presentLeaderboards
{
GKGameCenterViewController* gameCenterController = [[GKGameCenterViewController alloc] init];
gameCenterController.viewState = GKGameCenterViewControllerStateLeaderboards;
gameCenterController.gameCenterDelegate = self;
[self presentViewController:gameCenterController animated:YES completion:nil];
}