Home > Store

Learning Core Data for iOS: A Hands-On Guide to Building Core Data Applications, Rough Cuts

Rough Cuts

  • Available to Safari Subscribers
  • About Rough Cuts
  • Rough Cuts are manuscripts that are developed but not yet published, available through Safari. Rough Cuts provide you access to the very latest information on a given topic and offer you the opportunity to interact with the author to influence the final publication.

Not for Sale

Description

  • Copyright 2014
  • Dimensions: 7" x 9"
  • Pages: 350
  • Edition: 1st
  • Rough Cuts
  • ISBN-10: 0-13-337359-2
  • ISBN-13: 978-0-13-337359-2

This is the Rough Cut version of the printed book.

Get Started Fast with iOS 7 Core Data App Development
Covers iOS 7 and Xcode 5


This is the first Core Data book to fully reflect Apple’s latest platform innovations, including its dramatic  recent improvements to iCloud support. Hands-on from start to finish, it teaches you step-by-step as you create a modern data-driven iOS app using Storyboards, ARC, iOS 7, and Xcode 5.

Tim Roadley introduces new patterns and best practices designed to overcome the frustrations of Core Data development. One step at a time, you’ll build and extend your skills--even mastering advanced techniques such as complex model migration, deep copy, background processing, and integration with Dropbox, StackMob, and iCloud.

Downloadable versions of this book’s main project are provided with each chapter, so you can see exactly what your app project should look like--and get cookbook-style code for your own projects. Chapter exercises help you explore even further, whether you’re a self-learner or a student in an iOS development course.

If you’re an experienced iOS developer, this guide brings together all the skills, tools, code, and patterns you need to add powerful data management capabilities to any app--quickly, easily, and painlessly.

Coverage includes the following:
  • Understanding Core Data
  • Adding Core Data to an existing project
  • Designing, upgrading, and migrating data models (automatically and manually with progress indication)
  • Populating views with data, including table-views and picker-views
  • Preloading a “default data” persistent store from XML
  • Deep-copying from one persistent store to another
  • Performance tuning with Instruments, using large photos as the example
  • Background processing, using thumbnail generation as the example
  • Efficient search
  • Seamlessly backing up and restoring with Dropbox
  • Stable integration with iCloud--with full support for multiple accounts, seeding, and de-duplication
  • Web service integration with StackMob

Sample Content

Table of Contents

Preface xv
Chapter 1: Your First Core Data Application     1

What Is Core Data?     1
Persistent Store Coordinator     2
Managed Object Model     4
Managed Object Context     4
When to Use Core Data     5
Introducing Grocery Dude     5
Adding Core Data to an Existing Application     6
Introducing Core Data Helper     7
Core Data Helper Implementation     9
Files     9
Paths     10
Setup     11
Saving     14
Summary     16
Exercises     16
Chapter 2: Managed Object Model Basics     19
What Is a Managed Object Model?     19
Adding a Managed Object Model     20
Entities     20
Attributes     22
Integer 16/32/64     23
Float and Double     24
Decimal     25
String     25
Boolean     25
Date     25
Binary Data     26
Transformable     26
Attribute Settings     28
Subclassing NSManagedObject     29
Scalar Properties for Primitive Data Types     31
Snippet Demo Method     31
Creating a Managed Object     32
Backend SQL Visibility     33
Fetching Managed Objects     36
Fetch Request Sorting     38
Fetch Request Filtering     39
Fetch Request Templates     40
Deleting Managed Objects     42
Summary     43
Exercises     43
Chapter 3: Managed Object Model Migration     45
Changing a Managed Object Model     45
Adding a Model Version     47
Lightweight Migration     48
Default Migration     52
Migration Manager     57
Summary     69
Exercises     69
Chapter 4: Managed Object Model Expansion     71
Relationships     71
Delete Rules     77
Validation Errors     81
Entity Inheritance     86
Summary     90
Exercises     90
Chapter 5: Table Views     91
Table Views 101     91
Core Data Table Views     93
Introducing CoreDataTVC     93
Fetching     95
DATASOURCE: UITableView     96
DELEGATE: NSFetchedResultsController     98
AppDelegate’s CoreDataHelper Instance     104
Introducing PrepareTVC     105
Data     106
View     108
Interaction     114
Introducing ShopTVC     117
Data     117
View     118
Interaction     121
Summary     122
Exercises     122
Chapter 6: Views     125
Overview     125
The Target View Hierarchy     126
Introducing ItemVC     127
Keeping Reference to a Selected Item    

Updates

Submit Errata

More Information