iPhone 和 SQLite 介绍性文章或教程

发布于 2024-08-24 12:56:56 字数 352 浏览 5 评论 0原文

有哪些资源可以为 iPhone 初学者提供有关使用 SQLite 的信息?

  • 哪里可以下载适用于 iPhone 的 SQLite 软件?
  • 是否有多个版本,它们是否有实质性差异?
  • 在哪里可以找到一些入门教程?

我正在开发一个 iPhone 项目,其中的说明是将 PLIST 存储到 SQLite 中。我的 PLIST 将是一个读/写文件。这可能吗?

截至目前,我的 PLIST 是只读的,因此将其设为读/写 PLIST 非常重要。我的讲师建议的唯一方法是将其存储在 SQLite 中,在那里进行读/写。

请问,关于 iPhone 版 SQLite 的介绍有什么建议吗?

What resources are great to provide information on using SQLite for beginner iPhone developers?

  • Where to download the SQLite software for the iPhone?
  • Are there multiple versions, and do they have substantial differences?
  • Where can I find some introductory tutorials?

I'm working on an iPhone project where the instructions are to store PLISTs into SQLite. My PLIST would be a read/write file. Is this possible?

As of now my PLISTs are read-only, so it very important to make it a read/write PLIST. The only method my lecturer suggested is storing it in SQLite, where reading/writing would be done there.

Please, any suggestions on intros for SQLite for the iPhone?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

背叛残局 2024-08-31 12:56:56

SQLite 的主页是 http://www.sqlite.org/。其中包含大量文档和资源,包括教程和其他相关信息的链接。

该软件本身已安装在所有 Mac 和 iPhone 上,因此您无需下载。该命令行实用程序可以在 Mac 上作为 sqlite3 运行,这为您提供了一个可以运行 SQL 命令的交互式会话。 (有关完整详细信息,请参阅上面的文档。)

将 plist 存储在 SQLite 数据库中实际上没有意义(即使在技术上是可行的)。它们用于不同的事情。 plist 文件通常用于存储设置和首选项,而 SQLite 文件(它是独立的)用于实际数据,或作为 CoreData 使用的(不透明)持久性。无论如何,plist 文件应该是读/写的,但您应该使用系统 API 来管理访问,这样这就不会成为问题。

http://developer.apple.com/ 上的资源非常全面。听起来你有很多书要做!研究文档和示例代码,阅读网络上的一些教程(有很多),并尝试编写自己的小测试应用程序来探索技术。玩得开心!

The homepage for SQLite is http://www.sqlite.org/. This contains lots of documentation and resources, including tutorials and links to other related information.

The software itself is already installed on all Macs and iPhones, so you don't need to download it. The command-line utility can be run as sqlite3 on the Mac, and this gives you an interactive session where you can run SQL commands. (See the docs above for full details.)

It does not really make sense to store a plist in a SQLite database (even though it is technically possible). They are used for different things. A plist file is usually used for storing settings and preferences, while an SQLite file (it is self-contained) is used for actual data, or as (opaque) persistence as used by CoreData. The plist file should be read/write anyway, but you should be using the system APIs to manage access so this wouldn't be an issue.

The resources at http://developer.apple.com/ are comprehensive. It sounds like you have a lot of reading to do! Study the docs and sample code, read a few tutorials on the web (there are loads), and experiment with writing your own little test apps to explore techniques. Have fun!

橘和柠 2024-08-31 12:56:56

本教程分为四个部分。请按照此处说明的步骤进行操作。 icodeblog 的作者让它变得超级简单。

http ://icodeblog.com/2008/08/19/iphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-1/

非常感谢 icodeblog.com

There are four parts in this tutorial. Follow the steps explained here. The authors at icodeblog has made it super simple.

http://icodeblog.com/2008/08/19/iphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-1/

Many thanks to icodeblog.com

简单爱 2024-08-31 12:56:56

听起来你的教授正在给你一项人工任务,旨在锻炼你对两种不同类型的坚持的知识。如果他的设计要求要求您 (1) 读取 plist (2) 然后将结果数据存储在 sqlite 中,那么请遵循 gavinb 的建议。

但是,如果他只是给你一个在 sqlite 中存储数据的通用任务,你可以使用 核心数据即可完成相同的任务,而无需学习 SQL。

您提供的参数听起来不像现实世界的应用程序处理数据的方式。

Plist 是一种设计用于归档基于 NSFoundation 原始类和集合(即 NSString、NSNumber、NSArray、NSDictionary 等)的对象的格式。它几乎总是用于某种类型的应用程序首选项/资源。

SQLite和Core Data用于存储大量用户数据。当您有大型但简单的数据图(例如,具有简单文本字段且没有关系的 50,000 人记录)时,首选 SQLite。当您有非常复杂的对象图(例如,公司人员的模型,个人、其他个人和部门之间有无数的关系)时,首选核心数据。

It sounds like your prof is giving you an artificial task designed to exercise your knowledge of two different types of persistence. If his design requirements mandate that you (1) read a plist (2) then store the resulting data in sqlite, then go with gavinb's advice.

However, if he just gave you a generic task to store data in sqlite, you can use Core Data to accomplish the same task without having to learn SQL.

The parameters you gave don't sound like a the way a real world app would handle data.

Plist is a format designed to archive objects based on NSFoundation primitive classes and collections i.e. NSString, NSNumber, NSArray, NSDictionary etc. It's almost always used for app preferences/resources of some sort.

SQLite and Core Data are used to store large amounts of user data. SQLite is preferred when you have large but simple data graphs e.g. 50,000 people records with simple text fields and no relationships. Core Data is preferred when you have very complex object graphs e.g. a model for the personnel of a company with myriad relationships between individuals, other individuals and departments.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文