SQLite for iPhone SDK
After asking on the MacRumors forums I was pointed back to FMDB that I had looked at a couple of days ago. FMDB is a Cocoa wrapper for SQLite3. I had a look at it, and after my initial difficulties, I found that I was trying a way to complicated way to use it for my iPhone applications. To add FMDB, simply do the following:
- in XCode in your project window, rightclick your “Classes” and Add -> “New Group”, call it FMDB
- drag the files from src in the FMDB package into the new group
- Rightclick Frameworks, Add -> “Existing frameworks”, select /Developer/Platforms/Aspen.platform/Developer/SDKs/Aspen1.2.sdk/usr/lib/libsqlite3.dylib and press “Add”
- Compile, smile and start using it
Leave a Comment
If you would like to make a comment, please fill out the form below.
Hi Niklas,
Thanks for the tip!
I’m particularly interested in accessing the sqlite databases where Apple stores sms messages and call histories. Have any idea’s there?
Cheers,
Josh
Sorry, I haven’t looked at accessing the rest of the system, I’m just working within the applications I’m writing at the moment
I’m quite a newb so thanks for the tips, but after following these steps I get this Xcode error:
duplicate symbol _main in …/fmdb.o and …/main.o
I already have a file with a main method, so how do I include FMDB?
Ah, nevermind, I looked at the source closer and realized that fmdb.o is not part of the actual FMDB wrapper.
Nevermind, I checked out the source more and realized that fmdb.m is not part of the wrapper itself.
Thanks for posting that info. I have been trying to figure out how to use SQLite on iPhone for a while now. I’ll give it a shot and report back.