Join Bill Weinman for an in-depth discussion in this video Understanding SQLite in iOS, part of iOS SDK and SQLite: Building Data-Driven Apps (2013).
- View Offline
SQLite is a full featured relational database. It's small, it's fast, it's lightweight, and it's perfectly suited for mobile applications. The SQLite Database Management System lives entirely in a driver. This means that there is no server and no client. You access the database directly. The database itself is fully contained in one file. This makes it very convenient to use in a mobile environment. To say that iOS supports SQLite natively is to say that the driver is built-in, the interface to the driver is written in C, so it's not Object Oriented, and it's not an Objective-C Interface.
To make it easier to use, we will build a Native Object Oriented Interface for SQLite in Objective-C. This kind of interface is sometimes called a Wrapper as it wraps one interface around another. It's designed to be convenient and easy for our development purposes. It's general purpose, so you can use it in your future projects. You have the source code, and you may modify it and expand it to suite your needs. To further support the iOS Model-View-Controller architecture, we will build a more specific interface on top of our general interface.
We will do this by subclassing our general interface and adding methods to specifically support this application. This makes it very easy for us to integrate the database into our application. Subclassing a normalized interface like this is a common and valuable technique in an object-oriented environment. As you follow along with the development process in this chapter, think about how you will use and expand on these techniques in your own projects.
- Prototyping the app
- Coding and working with a testbed
- Creating an Objective-C interface for SQLite
- Designing a database schema
- Creating the view controllers
- Reading and writing to the database
- Parsing the RSS feed with NSXMLParser
- Updating the item view with feed items
- Implementing the pull to refresh gesture for iOS 6
- Creating a universal application with multiple views