I've heard that it's a bad idea to use plain SQLite3 in an iPhone project. Which frameworks, libs, wrappers, etc. do you use? Which are worth looking at?
我听说在iPhone项目中使用普通的SQLite3是个坏主意。您使用哪些框架,库,包装器等?哪个值得一看?
4 个解决方案
#1
Core Data is the way to go. It's only available in iPhone OS 3.0. This's not likely to be a problem though (for new apps).
核心数据是最佳选择。它仅适用于iPhone OS 3.0。这不太可能是一个问题(对于新的应用程序)。
#2
I have used C-API to SQLite on the iPhone and have no complaints at all. On the contrary, it works great.
我在iPhone上使用C-API到SQLite并且完全没有任何抱怨。相反,它很有效。
If you are planning to use Core Data, you'll be stuck with iPhone OS 3.0. If that's not a problem with you, you can go ahead and use it. But I guess, many people will still be using iPhone OS 2 during 2009.
如果您打算使用Core Data,那么您将无法使用iPhone OS 3.0。如果这不是你的问题,你可以继续使用它。但我想,很多人在2009年仍会使用iPhone OS 2。
#3
Same here, I recently had an app accepted by the App Store using SQLite to store its data.
同样,我最近在App Store接受了一个使用SQLite存储其数据的应用程序。
This link I found especially useful: iPhone SDK Tutorial: Reading data from a SQLite Database
我发现这个链接特别有用:iPhone SDK教程:从SQLite数据库中读取数据
Section (4) includes details of changes that you need to make to include the SQLite framework to your link options.
第(4)节包含了将SQLite框架包含在链接选项中所需进行的更改的详细信息。
(The main section of the tutorial shows you which files to import/include)
(本教程的主要部分显示了要导入/包含的文件)
#4
If you need to target iPhone 2.0, or if you want the ability to write specifically targeted SQL without resorting to use of the C API, I can recommend Gus Mueller's FMDB. This (along with the latest SQLite amalgamation for multithreaded access support) is what I use in Outpost.
如果您需要定位iPhone 2.0,或者您希望能够编写专门针对的SQL而无需使用C API,我可以推荐Gus Mueller的FMDB。这(以及用于多线程访问支持的最新SQLite合并)是我在Outpost中使用的。
#1
Core Data is the way to go. It's only available in iPhone OS 3.0. This's not likely to be a problem though (for new apps).
核心数据是最佳选择。它仅适用于iPhone OS 3.0。这不太可能是一个问题(对于新的应用程序)。
#2
I have used C-API to SQLite on the iPhone and have no complaints at all. On the contrary, it works great.
我在iPhone上使用C-API到SQLite并且完全没有任何抱怨。相反,它很有效。
If you are planning to use Core Data, you'll be stuck with iPhone OS 3.0. If that's not a problem with you, you can go ahead and use it. But I guess, many people will still be using iPhone OS 2 during 2009.
如果您打算使用Core Data,那么您将无法使用iPhone OS 3.0。如果这不是你的问题,你可以继续使用它。但我想,很多人在2009年仍会使用iPhone OS 2。
#3
Same here, I recently had an app accepted by the App Store using SQLite to store its data.
同样,我最近在App Store接受了一个使用SQLite存储其数据的应用程序。
This link I found especially useful: iPhone SDK Tutorial: Reading data from a SQLite Database
我发现这个链接特别有用:iPhone SDK教程:从SQLite数据库中读取数据
Section (4) includes details of changes that you need to make to include the SQLite framework to your link options.
第(4)节包含了将SQLite框架包含在链接选项中所需进行的更改的详细信息。
(The main section of the tutorial shows you which files to import/include)
(本教程的主要部分显示了要导入/包含的文件)
#4
If you need to target iPhone 2.0, or if you want the ability to write specifically targeted SQL without resorting to use of the C API, I can recommend Gus Mueller's FMDB. This (along with the latest SQLite amalgamation for multithreaded access support) is what I use in Outpost.
如果您需要定位iPhone 2.0,或者您希望能够编写专门针对的SQL而无需使用C API,我可以推荐Gus Mueller的FMDB。这(以及用于多线程访问支持的最新SQLite合并)是我在Outpost中使用的。