iPhone OS:实现自己的成果,我该怎么做?
我正在开发一款游戏,其中唯一的游戏部分是(至少现在)用户可以在整个游戏中做各种事情时解锁成就。我有一个数据库可以跟踪某些用户操作并记录用户执行某些操作的次数,但我无法找出构建应用程序的最佳方法,以便我必须做最少的工作。时机有点糟糕,因为游戏中心还没有准备好,而且 openfeint 似乎正在改变方向,但也许我错了。如果不是太荒谬的话,我宁愿“在内部”做所有事情。寻找建议。
我最难弄清楚的部分之一是如何管理所有成就的状态。 NSuserdefaults 与核心数据与平面数据文件。
如果核心数据字段达到一定数量,是否还可以发送通知?
谢谢,
尼克
I'm working on a game where really the only game part is (at least right now) that the user can unlock achievements as she does various things throughout the game. I have a database that can keep track of certain user actions and record how many times a user does something but I'm having trouble figuring out the best way to architect the app so that I have to do the least amount of work. Kind of suck with the timing because gamecenter is not ready and it seems like openfeint is changing gears, but maybe I'm wrong. I'd prefer to do everything "in house" if it is not too ridiculous. looking for suggestions.
One of the parts I'm having the most trouble figuring out is how to manage the state of all the achievements. NSuserdefaults vs. core data vs. a flat data file.
Also is there anyway to send a notification if a core data field reaches a certain amount?
Thanks,
Nick
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是仅将成就保留在设备上,还是也保留在服务器上?在设备上,没有理由不使用Core Data。
使用 Core Data,您可以在模型属性上使用 KVO 来监控某些值何时达到新的成就。
Are you keeping the achievements on the device only, or also on the server? On the device, there is no reason not to use Core Data.
Using Core Data, you could use KVO on your model properties to monitor when certain values reach a new achievements.