1

目标:当本地用户在他们的 ios 7 设备上单击应用程序中的排行榜按钮时,向本地用户显示默认排行榜。

[[GKLocalPlayer localPlayer] loadDefaultLeaderboardIdentifierWithCompletionHandler:(void(^)(NSString *leaderboardIdentifier, NSError *error)) {

    //Use the leaderboard identifier.
    MyLeaderBoardID
}]
4

1 回答 1

0

将 UIButton 链接到以下方法以显示默认排行榜:

- (void) presentLeaderboards
{
    GKGameCenterViewController* gameCenterController = [[GKGameCenterViewController alloc] init];
    gameCenterController.viewState = GKGameCenterViewControllerStateLeaderboards;
    gameCenterController.gameCenterDelegate = self;
    [self presentViewController:gameCenterController animated:YES completion:nil];
}
于 2014-09-05T04:21:21.087 回答