Changes

Jump to: navigation, search

An Example SQLite based iOS 4 iPhone Application

3 bytes added, 20:23, 19 January 2011
Creating and Preparing the SQLite Application Project
To include this library in the build directives, hold down the Ctrl key and click with the mouse on the Frameworks entry of the Groups and Files panel located on the left hand side of the Xcode project window. From the resulting menu, select the ''Add -> Existing Frameworks…'' option. Within the list of framework options, scroll down to the libsqlite3.dylib entry, select it and click on the Add button.
== Importing sqlite3.h and Declaring the Database Reference==
Before we can create a database we need to declare a variable pointer to a structure of type sqlite3 that will act as the reference to our database. Since we will be working with the database in the view controller for our application the best place to declare this variable is in the databaseViewController.h file. Since we also need to import the sqlite3.h header file into any files where we make use of SQLite this is also an ideal place to include the file. Within the main Xcode project window, select the databaseViewController.h file and modify it as follows:

Navigation menu