Book Image

Core Data iOS Essentials

By : Bintu Harwani, B. M. Harwani
Book Image

Core Data iOS Essentials

By: Bintu Harwani, B. M. Harwani

Overview of this book

Core Data is the essential ingredient in data driven iOS apps. It's used for storing, retrieving, and manipulating application data in databases, XML, and binary formats. It's an essential component for iPhone, iPod Touch, and iPad apps.Core Data Essentials provides a clear, readable guide to the most useful aspects of Core Data. Built around a realistic example app, the book showcases the most important aspects of Core Data development in the context of a complete, functioning app written in Objective C.The book starts with a tour of how the app works. Then you'll see how to easily display data using the Table View. You'll learn how to develop an appropriate data model that fits the needs of your app, then implement that model as updatable data objects. You'll see how to update data and build relationships between objects and learn how Core Data can work with search, and how to provide your users with friendly data editing features.
Table of Contents (19 chapters)
Core Data iOS Essentials
About the Author
About the Reviewers

Building data objects for the Customer entity

To build the data objects (classes) for the entity defined in the data model, perform the following steps:

  1. 1. Click on the entity in Data Model Editor and then go to File | New File.

  2. 2. We get a dialog box to choose a template for the new file. Select Cocoa Touch Class from under the iOS heading in the left pane and select the Managed Object Class template, as shown in the next screenshot followed by Next button. This template is visible only when the editing pane is currently showing a Core Data model and is the active pane.

  3. 3. We get a dialog box that prompts for the location of generating managed object class, as shown in the following screenshot. The name of the subclass is based on the Entity name, so we will not be prompted to provide name for the subclass. Keeping the values as default, let's click on the Next button.

  4. 4. Check the Customer entity in the dialog box that appears, as shown in the next screenshot (a subclass of NSManagedObject...