保存和加载数据(iphone sdk) [英] save and load data (iphone sdk)

查看:129
本文介绍了保存和加载数据(iphone sdk)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道在iphone应用程序中保存和加载数据的最佳方法是什么。

i'm wondering what's the best method to save and load data in a iphone application.

我正在尝试将字符串保存到文本文件或类似的东西中并将它们加载到表视图中,以便文本文件中的第一个条目是第一个表视图中的行等等......有人知道我怎么能意识到这一点?

i'm trying to save strings into a text file or something like that and load them into a table view, so that the first entry in the text file is the first row in the table view and so on... somebody got an idea how I could realize that?

提前感谢。

sean

thanks in advance.
sean

推荐答案

基本上有三种保存数据的方法:

There are basically three methods for saving data:


  • 使用文件管理器将文件保存到文件系统。 (但在你的情况下,你不应该这样做)它仅适用于大型图像文件。

  • 使用Sqlite将数据保存到关系数据库中。

  • 使用Core Data Framework保存所有数据。

在你的情况下,你一定要学习如何使用核心数据,这在第一次很难,但以后真的很舒服上。还有NSFetchedResultsController来处理加载到TableView中。

In your case, you should definitely learn how to use Core Data, it's hard at the first time, but it is really comfortable later on. There is as well the NSFetchedResultsController to handle the loading into TableView.

大多数实用程序应用程序使用Core Data来保存数据(Todo列表等等)。 Core Data的链接已由willcodejavaforfood发布。

Most of the utility applications use Core Data to save data (Todo lists, etc..). The link to Core Data has been posted by willcodejavaforfood.

这篇关于保存和加载数据(iphone sdk)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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