Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 如何在iOS 7中加载默认排行榜_Objective C_Ios7_Game Center_Gamekit_Game Center Leaderboard - Fatal编程技术网

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

Objective c 如何在iOS 7中加载默认排行榜,objective-c,ios7,game-center,gamekit,game-center-leaderboard,Objective C,Ios7,Game Center,Gamekit,Game Center Leaderboard,目标:当本地用户在其ios 7设备上单击应用程序中的排行榜按钮时,向其显示默认排行榜 [[GKLocalPlayer localPlayer] loadDefaultLeaderboardIdentifierWithCompletionHandler:(void(^)(NSString *leaderboardIdentifier, NSError *error)) { //Use the leaderboard identifier. MyLeaderBoardID }]

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

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

    //Use the leaderboard identifier.
    MyLeaderBoardID
}]

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

- (void) presentLeaderboards
{
    GKGameCenterViewController* gameCenterController = [[GKGameCenterViewController alloc] init];
    gameCenterController.viewState = GKGameCenterViewControllerStateLeaderboards;
    gameCenterController.gameCenterDelegate = self;
    [self presentViewController:gameCenterController animated:YES completion:nil];
}

这可能会有帮助:我想不出来。对iOS来说有点陌生有人能解释一下吗?