Thanks
Thanks

Reputation: 40329

What's the easiest way of using SQLite3 in iPhone-OS?

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?

Upvotes: 2

Views: 652

Answers (4)

Jim Dovey
Jim Dovey

Reputation: 11156

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.

Upvotes: 2

FractalDoctor
FractalDoctor

Reputation: 2546

Same here, I recently had an app accepted by the App Store using SQLite to store its data.

This link I found especially useful: iPhone SDK Tutorial: Reading data from a SQLite Database

Section (4) includes details of changes that you need to make to include the SQLite framework to your link options.

(The main section of the tutorial shows you which files to import/include)

Upvotes: 2

Pablo Santa Cruz
Pablo Santa Cruz

Reputation: 181280

I have used C-API to SQLite on the iPhone and have no complaints at all. On the contrary, it works great.

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.

Upvotes: 4

Mehrdad Afshari
Mehrdad Afshari

Reputation: 421978

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).

Upvotes: 5

Related Questions