Skip to Main Content
Beginning iOS 4 Application Development
book

Beginning iOS 4 Application Development

by Wei-Meng Lee
October 2010
Beginner content levelBeginner
655 pages
14h 9m
English
Wrox
Content preview from Beginning iOS 4 Application Development

Chapter 11. Database Storage Using SQLite3

WHAT YOU WILL LEARN IN THIS CHAPTER

  • How to use the SQLite3 database in your Xcode project

  • How to create and open a SQLite3 database

  • How to use the various SQLite3 functions to execute SQL strings

  • How to use bind variables to insert values into a SQL string

  • How to bundle a pre-built SQLite database with your application

As you continue on your iPhone development journey, you will soon realize that your application needs to find a way to save data. For example, you may want to save the text that the user is entering into a Text Field, or in an RSS application the last item that the user has read.

For simple applications, you can write the data you want to persist to a simple text file. For more structured data, you can use a property list. For large and complex data, it is more efficient to store it using a database. The iPhone comes with the SQLite3 database library, which you can use to store your data. With your data stored in a database, your application can populate a Table view or store a large amount of data in a structured manner.

Note

Besides using SQLite for data storage, developers can also use another framework for storage: Core Data. Core Data is part of the Cocoa API, which was first introduced in the iPhone SDK 3.0. It is basically a framework for manipulating data without worrying about the details of storage and retrieval. A discussion of Core Data is beyond the scope of this book.

This chapter shows you how to use the embedded SQLite3 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning iOS 5 Application Development

Beginning iOS 5 Application Development

Wei-Meng Lee

Publisher Resources

ISBN: 9780470918029Purchase book