加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

使用swift在ios 8 app中显示Game Center挑战而不是排行榜

发布时间:2020-12-14 04:27:14 所属栏目:百科 来源:网络整理
导读:我正在使用 swift编程开发ios 8应用程序. 我正在尝试使用gamecentercontroller显示游戏中心排行榜.但每次它都显示挑战状态而不是排行榜.这是我用过的代码. func showLeaderboard(){ var gcViewController: GKGameCenterViewController = GKGameCenterViewCon
我正在使用 swift编程开发ios 8应用程序.
我正在尝试使用gamecentercontroller显示游戏中心排行榜.但每次它都显示挑战状态而不是排行榜.这是我用过的代码.

func showLeaderboard()
{
        var gcViewController: GKGameCenterViewController = GKGameCenterViewController()
        gcViewController.leaderboardIdentifier = myLeaderboardIdentifier

        gcViewController.viewState = GKGameCenterViewControllerState.Leaderboards
        gcViewController.gameCenterDelegate = self
        let vc = self.view?.window?.rootViewController
        vc?.presentViewController(gcViewController,animated: true,completion: nil)
}

当我尝试使用默认状态时

gcViewController.viewState = GKGameCenterViewControllerState.Dafault

然后它显示一个空白的白色视图(甚至没有挑战)

只是一个狂热的怀疑“它与沙盒模式有什么关系”

有人请帮忙.长期坚持下去.

解决方法

当我写信给Apple时,它自动开始了. 似乎是Apple的一个问题.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读