PacktLib: Core Data iOS Essentials

Core Data iOS Essentials


About the Author


About the Reviewers




A brief history

Source code

Shall we begin?

Understanding Core Data

Core Data

Data Model

Model View Controller (MVC)

Core Data API

Overview of the application: Sales Record System for a Departmental Store

Entity Relationship Diagram

An application output sample

Automatic Master Product Update


Understanding Objective-C Protocol and Table View


Creating a sample application using a protocol and a delegate

Introduction to Table View

Creating an application to display Table View cells

Adding names to the Table View


Designing a Data Model and Building Data Objects for Customers

Creating a new project

Designing the data model

Building data objects for the Customer entity

Understanding code of autogenerated files


Creating, Listing, and Deleting Names of Customers

Splitting the task into two modules

Creating a module to save and delete a customer's name

Key value coding (KVC)

Implementing the methods of the NSFetchedResultsControllerDelegate protocol

Running the project


Creating, Listing, Displaying, and Deleting Records of Customers

Understanding multiple managed object context

Applying the concept of multiple managed object context in our application

Enhancing our application to save, list, display, and delete customer information

viewDidLoad method

cell AtIndexPath method

didSelectRowAtIndexPath method

addCustomer method

addcustomerController method


Updating and Searching Records of Customers

Applying the update feature

Using KVO to know what has been updated

Running the project

Applying search facility

Understanding NSPredicate

Removing the keyboard after selecting a customer's name

Using Predicate Builder for creating a search criterion


Entering, Saving, Listing, and Deleting the Records of the Products Sold to the Customers

Adding the product entity to the Data Model


Establishing a relationship between the Customer and the Product entities

Building the data object for the Customer and the Product entities

Entering the information of the products sold to the customers

Creating a module to develop an interface to enter the product information

Developing a module to create a menu for manipulating the product information

Creating a module to connect the Product's menu to the rest of the project

Running the project


Entering, Displaying, and Deleting the Stock

Adding the MasterProduct entity to the Data Model

Storing the image of the MasterProduct

Building the data object for the MasterProduct entity

Maintaining the MasterProduct information


Editing the Stock Information

Module to connect the MasterProduct's menu to the rest of the project

Running the application

Module to modify the information of the master product


Displaying the Products for Sale and Updating the Stock

Displaying the products available for sale

Updating the stock

Automatically updating the quantity of the product in the MasterProduct entity