about percentComplete in GKAchievement

老子叫甜甜 提交于 2019-12-10 13:57:35

问题


After testing, I find that though the type of percentComplete of GKAchievement is double, and in apple's help document the legal values is between 0.0 and 100.0. but if you report percentComplete=1.5 to apple server, next time you will get the value percentComplete=1.0(another example, report 0.5, get 0.0). So I just think this may be a bug of percentComplete. Now our project has some achievements need be accumulated, like finish 200 times of play, we
don't save the value in local, but report current counted times to apple server, for next time's calculation.

I just tested in SandBox with iOS 4.2, I don't know whether it only occurs in SandBox, so does anybody also find this problem, what's your workround?


回答1:


Answer from Apple: "The percentages are reported using doubles but stored as whole number percentages, e.g. 1%, 2%, 3%, ..., 100%.
You should probably store the progress locally anyways, since they might be someplace they can't connect to Game Center."

For those with access to Apple dev forums: https://devforums.apple.com/message/522769



来源:https://stackoverflow.com/questions/7131728/about-percentcomplete-in-gkachievement

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!