首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在iOS 7中加载默认排行榜

如何在iOS 7中加载默认排行榜
EN

Stack Overflow用户
提问于 2014-08-26 06:45:18
回答 1查看 94关注 0票数 1

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

代码语言:javascript
复制
[[GKLocalPlayer localPlayer] loadDefaultLeaderboardIdentifierWithCompletionHandler:(void(^)(NSString *leaderboardIdentifier, NSError *error)) {

    //Use the leaderboard identifier.
    MyLeaderBoardID
}]
EN

回答 1

Stack Overflow用户

发布于 2014-09-05 12:21:21

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

代码语言:javascript
复制
- (void) presentLeaderboards
{
    GKGameCenterViewController* gameCenterController = [[GKGameCenterViewController alloc] init];
    gameCenterController.viewState = GKGameCenterViewControllerStateLeaderboards;
    gameCenterController.gameCenterDelegate = self;
    [self presentViewController:gameCenterController animated:YES completion:nil];
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25495453

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档