O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Core Data in Objective-C, 3rd Edition

Book Description

Core Data is Apple's data storage framework: it's powerful, built-in, and can integrate with iCloud. Discover all of Core Data's powerful capabilities, learn fundamental principles including thread and memory management, and add Core Data to both your iOS and OS X projects. All examples in this edition are based on Objective-C and are up-to-date for the latest versions of OS X El Capitan and iOS 9.

Table of Contents

  1.  Introduction
    1. Is This Book for You?
    2. What Is Core Data?
    3. Online Resources
  2. 1. Building a Foundation
    1. The Storyboard
    2. The Recipe List
    3. The Recipe Detail
    4. The Edit Workflow
    5. Ready for Core Data
  3. 2. Under the Hood of Core Data
    1. Introducing the NSManagedObjectModel
    2. Integrating with the NSPersistentStoreCoordinator
    3. Adding the NSManagedObjectContext
    4. Working with NSManagedObject Instances
    5. Building an NSFetchRequest
    6. NSSortDescriptor
    7. Wrapping Up
  4. 3. iOS: NSFetchedResultsController
    1. How to Use the NSFetchedResultsController
    2. Under the Hood of the NSFetchedResultsController
    3. Building Our Own: ZSContextWatcher
    4. Wrapping Up
  5. 4. Versioning and Migration
    1. Some Maintenance Before We Migrate
    2. A Simple Migration
    3. The Difference Between Light and Heavy Migrations
    4. A Heavy/Manual Migration
    5. Fundamentals of Core Data Versioning
    6. Progressive Data Migration (An Academic Exercise)
    7. Wrapping Up
  6. 5. Performance Tuning
    1. Persistent Store Types
    2. Optimizing Your Data Model
    3. Fetching
    4. Faulting
    5. Access Patterns
    6. Wrapping Up
  7. 6. Threading
    1. Threading and Core Data
    2. Working on the Main Queue
    3. Working off the Main Queue
    4. Interqueue Communication
    5. Parent/Child NSManagedObjectContext Design
    6. Export Operation
    7. Import Operation
    8. Asynchronous Saving
    9. Debug Concurrency Checking
    10. Wrapping Up
  8. 7. Bulk Changes
    1. Running with Scissors
    2. Doing Bulk Updates
    3. Notifying the Application of Changes
    4. Bulk Deletes
    5. Things to Consider When Using the Bulk Change APIs
    6. Wrapping Up
  9. 8. Using Core Data with iCloud
    1. Introducing the UIManagedDocument
    2. Direct NSManagedObjectContext to iCloud
    3. Consuming Changes from iCloud
    4. Under the Hood
    5. Migrating an Existing Application
    6. Desktop iCloud Integration
    7. Issues with Data Quantities
    8. Sharing Data Between iOS and OS X
    9. Wrapping Up
  10. 9. Adding a Desktop Foundation
    1. Our Application
    2. Our Application Design
    3. Sharing the Data Model
    4. Building the Controller Layer
    5. Building the User Interface
    6. Adding a Splash of Code
    7. Wrapping Up
  11. 10. OS X: Bindings, KVC, and KVO
    1. Key Value Coding
    2. Key Value Observing
    3. Cocoa Bindings and Core Data
    4. Other Interface Elements That Use KVO, KVC, and Core Data
    5. Wrapping Up
  12. 11. Spotlight, Quick Look, and Core Data
    1. Integrating with Spotlight
    2. Integrating with Quick Look
    3. Putting It All Together
    4. Wrapping Up
  13. 12. Dynamic Parameters
    1. Building the Xcode Example Project
    2. The DocumentPreferences Object
    3. Using Document Preferences
    4. Wrapping Up
  14.  Bibliography