Saving And Loading Up A Highscore In Swift Using NSUserDefaults

后端 未结 3 523
遇见更好的自我
遇见更好的自我 2020-12-04 00:56

I am having some problems while attempting to compare my score and highscore to see which one is bigger and then save it. I think the problem lies in the comparison and savi

3条回答
  •  半阙折子戏
    2020-12-04 02:03

    Swift 2: You have set an integer value in userDefaults so, you may try retrieve it using, defaults.integerForKey(score, forKey: "highscore")

提交回复
热议问题