GKLeaderboardViewController

GKLeaderboardViewController

本文介绍了GKLeaderboardViewController初始排行榜的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

显示GKLeaderboardViewController时,即使未设置GKLeaderboardViewController的排行榜类别,它也会显示列表中的第一个排行榜.要查看所有排行榜的列表,唯一的方法是单击顶部的排行榜按钮.

When GKLeaderboardViewController is presented, it shows first leaderboard on the list, even if the GKLeaderboardViewController's leaderboard category is not set. Only way to see the list of all leaderboards is clicking Leaderboards button at the top.

显示GKLeaderboardViewController时,是否可以显示所有排行榜的列表?

Is there any way to display list of all leaderboards when GKLeaderboardViewController is presented?

推荐答案

您可以将category设置为nil.

You can set category to nil.

    GKLeaderboardViewController *leaderboardController = [[GKLeaderboardViewController alloc] init];
    if (leaderboardController != NULL)
    {
        //leaderboardController.category = kLeaderboardID;
        leaderboardController.category = nil;
        leaderboardController.timeScope = GKLeaderboardTimeScopeWeek;
        leaderboardController.leaderboardDelegate = self;
        [self presentModalViewController: leaderboardController animated: YES];
    }
    [leaderboardController release];

这篇关于GKLeaderboardViewController初始排行榜的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-16 09:13