Objective-C保存数据的最佳选择 [英] Objective-C best choice for saving data

查看:177
本文介绍了Objective-C保存数据的最佳选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在寻找在我的iPhone应用程序中保存数据的最佳方法;将在应用程序的打开和关闭之间持续的数据。我已经研究归档使用NSKeyedArchiver,我已经成功地使其工作。但是,我注意到,如果我尝试保存多个对象,他们不断被覆盖每次我保存。 (本质上,用户将能够创建他/她想要的事物的列表,保存列表,创建几个列表,保存它们,然后能够回去并选择任何这些列表以在未来加载日期。)

I'm currently looking for the best way to save data in my iPhone application; data that will persist between opening and closing of the application. I've looked into archiving using a NSKeyedArchiver and I have been successful in making it work. However, I've noticed that if I try to save multiple objects, they keep getting overwritten every time I save. (Essentially, the user will be able to create a list of things he/she wants, save the list, create a few more lists, save them all, then be able to go back and select any of those lists to load at a future date.)

我听说过SQLite,Core Data,或者使用.plists存储多个数据数组,这些数组会随着时间的推移而持续下去。有人能指点我最好的方向来保存我的数据吗?感谢!

I've heard about SQLite, Core Data, or using .plists to store multiple arrays of data that will persist over time. Could someone point me in the best direction to save my data? Thanks!

推荐答案

核心数据非常强大,易于使用,一旦你超过初始学习曲线。这里是一个很好的教程,帮助您开始 - clicky

Core Data is very powerful and easy to use once you get over the initial learning curve. here's a good tutorial to get you started - clicky

这篇关于Objective-C保存数据的最佳选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆