我应该保存plist还是Core Data? [英] Should I save in plist or Core Data?

查看:88
本文介绍了我应该保存plist还是Core Data?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道我是否应该将我的应用程序中的数据保存到plist或使用Core Data ..

I'm wondering if I should save data in my app to a plist or using Core Data..

我的应用程序只是基本上保存来自时间轴和其他用户。这小于几个hunderd kB(约200 kb在我的测试)。使用核心数据有什么优点?

My app is just basically saving tweets from timeline and other users now. Which is less than a few hunderd kB (about 200 kb in my testing). What's the advantages of using core data?

推荐答案

我不会考虑plist除了保存简单的偏好和真正的基本数据结构。更好的性能,检索和保存数据到plists可能很慢。

I would not consider plists for anything other than saving simple preferences and really basic data structure. Plus performance wise, retrieving and saving data to plists can be quite slow.

在Coredata长时间的努力后,现在我终于得到它,我会选择它任何一天。是的,它有一个陡峭的学习曲线,但有这么多,你得到免费与它,我一定会投资时间学习和探索它。

After struggling with Coredata for a long time, now that I finally get it I would choose it over anything any day. Yes it does have a bit of a steep learning curve but there is so much you get "for free" with it, I'd definitely invest the time to learn and explore it.

Coredata可以灵活地根据需要扩展对象模型,根据某些参数轻松从持久化存储中获取对象,在模型之间创建关系,内存管理和列表。

Coredata will give you flexibility to expand your object models as needed, easily fetch objects from the persistant storage based on certain parameters, create relationships between models, memory management and the list goes on.

Coredata真的很好地记录在苹果,所以你会找到你需要的一切,开始加更多。有例子,示例项目,视频,你命名它 - 所以我一定会建议你看看如果你对性能,可扩展性和有趣的一点):

Coredata is really well documented by Apple so you will find everything you need to get started plus more. There are examples, sample projects, videos, you name it - so I'd definitly recommend you have a look IF you are interested in performance, scalability and having a bit of fun too :)

这篇关于我应该保存plist还是Core Data?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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