如何使用swift从Game Center中检索用户的最高分

时间:2015-05-13 00:18:48

标签: ios swift game-center game-center-leaderboard

我想检索最后得分,将其添加到我当前的游戏时间得分中。我尝试过使用

delegate.onLocalPlayerScoreReceived(leaderboardRequest.localPlayerScore)

但它不起作用。我在这一部分有一个错误,说未解决的标识符委托

let leaderboardRequest = GKLeaderboard() as GKLeaderboard!
if leaderboardRequest != nil
{
    leaderboardRequest.loadScoresWithCompletionHandler({ (scores:[AnyObject]!, error:NSError!) -> Void in
        if error != nil
        {
            //handle error
        }
        else
        {
            delegate.onLocalPlayerScoreReceived(leaderboardRequest.localPlayerScore)
        }
    })
}

0 个答案:

没有答案