27. Core Data

Using the C API for SQLite is one way to store and access data on the iPhone. The Core Data framework simplifies this process by providing an ORM for Objective-C and SQLite. ORM stands for Object-Relational Mapping. If you think of a table in a relational database as a class, then each row represents one instance of the class and each column represents an instance variable. Core Data fetches rows from the table and turns them into objects (Figure 27.1). When these objects are edited, Core Data updates the row in the table accordingly. It also takes care of inserting and deleting rows as objects are created and destroyed.

Figure 27.1. Role of Core Data

The class/table is known as an entity in Core Data. The column/instance variable ...

Get iPhone Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.