tags:

views:

9400

answers:

9

I'm looking for an complete tutorial which not just tells me how an query is executed, but also how I set up the whole thing including setting up the library, creating an database, and so on.

+7  A: 

Using sqlite3 on the iPhone is really not that different from using it on any other platform. You should read the general sqlite docs you can find here: http://www.sqlite.org/docs.html

In your iPhone App, you usually open your sqlite database in the applicationDidFinishLaunching: method of your application delegate. After that, you can just use your database.

I've used Gus Mueller's FMDatabase classes on the iPhone. They provide a thin wrapper around sqlite.

A final note: It seems CoreData will become available on the iPhone with OS version 3. You can use sqlite through the CoreData framework.

rincewind
great answer :-)
Raj
+2  A: 

Take a look at this book:

Beginning iPhone Development: Exploring the iPhone SDK by Dave Mark (Nov, 2008)

There is a section dedicated to SQLite.

Koistya Navin
I have that one. But I find it very hard to follow on the SQLlite part. I jumped straight forward to that chapter, and the examples there simply didn't work out for me. I guess that they described something I must know in the chapters about persistance before. But I dont care about files.
Thanks
+2  A: 

I really like the tutorials from:

http://www.iphonesdkarticles.com/search/label/SQLite

it should get you started in no-time.

Wim Haanstra
really? they say that their SQLite tutorials are deprecated... whatever that means.
Thanks
+1  A: 

hey apart from peter quade's excellent answer, may i also suggest you to check out http://www.iphonekicks.com/tags/SQLite - here you would find many bookmarks to sqlite topics

and just fyi, iphonekicks.com is a social book marking site, a digg clone but purely for iphone sdk links :-)

Raj
A: 

try this library I just wrote, it helps people who knows the SQL but not the Objective-C (you need to have some basic knowledge)

SQLite3 handling library

The entire project is on the google code as well with a sample application which shows you how to connect data to the UITableView

Ondrej
A: 

I have some iphone sqlite links in my delicious bookmarks, There should be enough links there to teach you all the sqlite you will ever need. Lots of the tutorials are pretty simple and easy to understand. There are a few wrappers out there too. I haven't used any of the wrappers, but they look interesting. Also Check out other bookmarked items tagged sqlite on delicious.

Iggy
+1  A: 

Stanfords cs193p iPhone application development previous semester showed how to setup and use sqlite3 with iphone.

I haven't checked the latest lecture's but there is a reference to sqlite in latest semester. There are lecture notes and video in iTunesU - check out cs193p web site for links/references/example code/lecture notes.

stefanB
A: 

iCodeBlog's has got a very well written tutorial on sqlite3 as well.. check out part 1/4 here: http://icodeblog.com/2008/08/19/iphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-1/

Kian Cheong
A: 

i may be little late but this could be helpful for others http://www.youtube.com/watch?v=y01GJ-wtcEI

Mohamed Emad Hegab