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.
Where can I find it?
SQLite is available by default on iOS. In fact, if you've used Core Data before, you've already used SQLite.
Step 1 − Open Xcode -→ Single View Application -→ Let's name is DBSqlite. Step 2 − Let's develop our UI, Open Main. storyboard and add one text field and two buttons as shown below. Step 3 − Create @IBAction for both the buttons and @IBOutlet for text field and name them btnInsert, btnShowData and name respectively.
The database that can be used by apps in iOS (and also used by iOS) is called SQLite, and it's a relational database. It is contained in a C-library that is embedded to the app that is about to use it.
Supports drag and drop to import or export SQLite databases and SQL files in iPad. Supports show records count of each table. Supports show size of each table's content. Supports show size of each table's index.
Using SQLite 3 on the iPhone is really not that different from using it on any other platform. You should read the general SQLite documentation.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With