哪种数据存储类型是存储从服务器接收的数据的最佳数据存储类型?
我有从服务器接收到的某些数据,我称之为历史记录。每次我访问某个网站时,我都必须将 URL 保存在历史记录列表中。 该列表稍后将显示在表格中,供用户查看。 我应该在 iPhone 上使用什么数据存储类型?这个列表可以存储在 NSUserDefaults 中还是我必须使用 CoreData?
I have certain data that is received from the server, I call it History. Everytime I visit some website, I have to save the URL in the History list.
The list will be displayed in a table later on, for the user to view.
What data storage type should I use on iPhone? Can this list be stored in NSUserDefaults
or I have to use CoreData?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您计划存储的数据很简单,那么 NSUserDefaults 就可以正常工作。如果它很复杂,那么 core data 或 sqlite 是一些选择。
这是一篇关于存储选项的精彩文章:NSUserDefaults 有哪些限制?
<一href="https://stackoverflow.com/questions/471830/why-nsuserdefaults-failed-to-save-nsmutabledictionary-in-iphone-sdk">这是另一篇文章,讨论您需要做的事情如果您正在处理复杂的数据并希望使用
NSUserDefaults
存储它。If the Data you plan on storing is simple, then
NSUserDefaults
will work fine. If it's complex, then core data or sqlite are some alternatives.Here is a great post on storage options: What are the limitations of NSUserDefaults?
Here is another post that talks about things you need to do if you are working with complex data and want to store it with
NSUserDefaults
.