Who Should Read This Document
Organization of This Document
See Also
The Core Data framework provides generalized and automated solutions to common tasks associated with object life-cycle and object graph management, including persistence. Its features include:
Built-in management of undo and redo beyond basic text editing
Automatic validation of property values to ensure that individual values lie within acceptable ranges and that combinations of values make sense
Change propagation, including maintaining the consistency of relationships among objects
Grouping, filtering, and organizing data in memory and in the user interface
Automatic support for storing objects in external data repositories
Optional integration with Cocoa bindings to support automatic user interface synchronization
You should read this document to gain an understanding of the Core Data framework. You are expected to be familiar with the basics of Cocoa development, including the Objective-C language and memory management.
Important: Although this document provides a thorough treatment of the fundamentals of the Core Data framework, simply reading from start to finish is not a good strategy for learning how to use the technology effectively. Instead, you should typically augment your understanding by following the related tutorials provided in the Reference Library. For a description of the recommended learning path, see Core Data Overview.
The following articles explain the problems the Core Data Framework addresses, the solutions it provides, its basic functionality, and common tasks you might perform:
“Core Data Basics” describes the fundamental aspects of the technology.
“Managed Object Models” describes the features of a managed object model.
“Using a Managed Object Model” describes how you use a managed object model in your application.
“Managed Objects” describes the features of a managed object, the NSManagedObject
class, and how and why you might implement a custom class to represent an entity.
“Managed Object Accessor Methods” describes how to write accessor methods for custom managed objects.
“Creating and Deleting Managed Objects” describes how to correctly instantiate and delete managed objects programmatically.
“Fetching Managed Objects” describes how to fetch managed objects, and some considerations to ensure that fetches are efficient.
“Using Managed Objects” describes issues related to manipulating managed objects in your application.
“Memory Management Using Core Data” describes aspects of memory management when using Core Data.
“Relationships and Fetched Properties” describes relationships, how to model them, and issues related to manipulating relationships between managed objects. It also describes fetched properties, which are like weak unidirectional relationships.
“Non-Standard Persistent Attributes” describes how to use attributes with non-standard value types (such as colors and C-structures).
“Managed Object Validation” describes types of validation, how to implement validation methods, and when to use validation.
“Faulting and Uniquing” describes how Core Data constrains the size of the object graph, and ensures that each managed object within a managed object context is unique.
“Using Persistent Stores” describes how you create a persistent store, how you can migrate a store from one type to another, and manage store metadata.
“Core Data and Cocoa Bindings” describes how Core Data integrates with and leverages Cocoa bindings.
“Change Management” describes the issues that may arise if you create multiple managed object contexts or multiple persistence stacks.
“Persistent Store Features” describes the features of the different types of store, and how you can configure the behavior of the SQLite store.
“Multi-Threading with Core Data” describes some issues related to multi-threading a Core Data application.
“Core Data Performance” describes techniques you can use to ensure a Core Data application is as efficient as possible.
“Troubleshooting Core Data” describes common errors developers make when using Core Data, and how to correct them.
“Efficiently Importing Data” describes how you can import data into a Core Data application.
“Core Data FAQ” provides answers to questions frequently asked about Core Data.
“Glossary” provides a glossary of terms used in Core Data.
Many enhancements were introduced for Core Data on Mac OS X v10.5. This document addresses primarily the v10.5 release, however where possible an explanation of functionality on v10.4 is also provided inline. To avoid confusion, the following articles from the v10.4 release of the documentation are provided in full.
“Mac OS X v10.4: Using Managed Objects” describes issues related to manipulating managed objects in your application on Mac OS X v10.4.
“Mac OS X v10.4: Managed Object Accessor Methods” describes how to implement custom accessor methods on Mac OS X v10.4.
“Mac OS X v10.4: Non-Standard Persistent Attributes” describes how to use attributes with non-standard value types (such as colors and C-structures) on Mac OS X v10.4.
“Mac OS X v10.4: Versioning” describes how to deal with changes to your application's schema and data migration on Mac OS X v10.4.
You should also refer to:
Building a Sample Core Data Application (ADC Video)
CoreRecipes (ADC Sample Code)
ManagedObjectDataFormatter (A plugin for Xcode)
© 2004, 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-03-04)