Framework

Core Data

Create generalized and automated solutions to common tasks associated with object life-cycle and object graph management, including persistence.

Overview

This collection of documents provides the API reference for the Core Data framework. Core Data provides object graph management and persistence for Foundation and Cocoa applications. For more details, see Core Data Basics

Symbols

Classes

NSAsynchronous​Fetch​RequestNSAsynchronous​Fetch​Result
NSAtomic​Store

NSAtomic​Store is an abstract superclass that you can subclass to create a Core Data atomic store. It provides default implementations of some utility methods. You use a custom atomic store if you have a custom file format that you want to integrate with a Core Data application.

NSAtomic​Store​Cache​Node

NSAtomic​Store​Cache​Node is a concrete class to represent basic nodes in a Core Data atomic store.

NSAttribute​Description

The NSAttribute​Description class is used to describe attributes of an entity described by an instance of NSEntity​Description.

NSBatch​Delete​RequestNSBatch​Delete​ResultNSBatch​Update​RequestNSBatch​Update​ResultNSConstraint​Conflict
NSEntity​Description

An NSEntity​Description object describes an entity in Core Data. Entities are to managed objects what Class is to id, or—to use a database analogy—what tables are to rows. An instance specifies an entity’s name, its properties (its attributes and relationships, expressed by instances of NSAttribute​Description and NSRelationship​Description) and the class by which it is represented.

NSEntity​Mapping

Instances of NSEntity​Mapping specify how to map an entity from a source to a destination managed object model.

NSEntity​Migration​Policy

Instances of NSEntity​Migration​Policy customize the migration process for an entity mapping.

NSExpression​Description

Instances of NSExpression​Description objects represent a special property description type intended for use with the NSFetch​Request properties​To​Fetch method.

NSFetched​Property​Description

The NSFetched​Property​Description class is used to define “fetched properties.” Fetched properties allow you to specify related objects through a weak, unidirectional relationship defined by a fetch request.

NSFetched​Results​Controller

You use a fetched results controller to efficiently manage the results returned from a Core Data fetch request to provide data for a UITable​View object.

NSFetch​Request

A description of search criteria used to retrieve data from a persistent store.

NSFetch​Request​Expression

Instances of NSFetch​Request​Expression represent expressions which evaluate to the result of executing a fetch request on a managed object context.

NSIncremental​Store

NSIncremental​Store is an abstract superclass defining the API through which Core Data communicates with a store. This interface is designed to allow you to create persistent stores which load and save data incrementally, allowing for the management of large and/or shared datasets. See Incremental Store Programming Guide for an implementation strategy and best practices when implementing your own incremental store.

NSIncremental​Store​Node

NSIncremental​Store​Node is a concrete class to represent basic nodes in a Core Data incremental store.

NSManaged​Object

NSManaged​Object is a generic class that implements all the basic behavior required of a Core Data model object. It is not possible to use instances of direct subclasses of NSObject (or any other class not inheriting from NSManaged​Object) with a managed object context. You may create custom subclasses of NSManaged​Object, although this is not always required. If no custom logic is needed, a complete Object graph can be formed with NSManaged​Object instances.

NSManaged​Object​Context

An instance of NSManaged​Object​Context represents a single “object space” or scratch pad in an application. Its primary responsibility is to manage a collection of managed objects. These objects form a group of related model objects that represent an internally consistent view of one or more persistent stores. A single managed object instance exists in one and only one context, but multiple copies of an object can exist in different contexts. Thus object uniquing is scoped to a particular context.

NSManaged​Object​ID

An NSManaged​Object​ID object is a compact, universal identifier for a managed object. This forms the basis for uniquing in the Core Data Framework. A managed object ID uniquely identifies the same managed object both between managed object contexts in a single application, and in multiple applications (as in distributed systems). Identifiers contain the information needed to exactly describe an object in a persistent store (like the primary key in the database), although the detailed information is not exposed. The framework completely encapsulates the “external” information and presents a clean object oriented interface.

NSManaged​Object​Model

An NSManaged​Object​Model object describes a schema—a collection of entities (data models) that you use in your application.

NSMapping​Model

Instances of NSMapping​Model specify how to map from a source to a destination managed object model.

NSMerge​Conflict

A merge conflict encapsulates conflicts that occur when attempting to save changes in a managed object context.

NSMerge​Policy

You use a merge policy object to resolve conflicts between the persistent store and in-memory versions of managed objects.

NSMigration​Manager

Instances of NSMigration​Manager perform a migration of data from one persistent store to another using a given mapping model.

NSPersistent​Container

A container that encapsulates the Core Data stack in your application.

NSPersistent​Store

This class is the abstract base class for all Core Data persistent stores.

NSPersistent​Store​Asynchronous​Result
NSPersistent​Store​Coordinator

Instances of NSPersistent​Store​Coordinator associate persistent stores (by type) with a model (or more accurately, a configuration of a model) and serve to mediate between the persistent store or stores and the managed object context or contexts. Instances of NSManaged​Object​Context use a coordinator to save object graphs to persistent storage and to retrieve model information. A context without a coordinator is not fully functional as it cannot access a model except through a coordinator. The coordinator is designed to present a façade to the managed object contexts such that a group of persistent stores appears as an aggregate store. A managed object context can then create an object graph based on the union of all the data stores the coordinator covers.

NSPersistent​Store​Description

A description object used to create and/or load a persistent store.

NSPersistent​Store​Request

An instance of NSPersistent​Store​Request describes criteria used to retrieve data from or save data to Persistent store.

NSPersistent​Store​Result
NSProperty​Description

The NSProperty​Description class is used to define properties of an entity in a Core Data managed object model. Properties are to entities what instance variables are to classes.

NSProperty​Mapping

Instances of NSProperty​Mapping specify in a mapping model how to map from a property in a source entity to a property in a destination entity.

NSQuery​Generation​Token
NSRelationship​Description

The NSRelationship​Description class is used to describe relationships of an entity in an NSEntity​Description object.

NSSave​Changes​Request

A save changes request encapsulates a collection of changes to be made by an object store in response to a save operation on a managed object context.

Protocols

NSFetched​Results​Controller​Delegate

An instance of NSFetched​Results​Controller uses methods in this protocol to notify its delegate that the controller’s fetch results have been changed due to an add, remove, move, or update operations.

NSFetched​Results​Section​Info

This protocol defines the interface for section objects vended by an instance of NSFetched​Results​Controller.

NSFetch​Request​Result

Reference

Core Data Constants

This document describes the constants defined in the Core Data framework and not described in a document for an individual class.

Core Data EnumerationsCore Data Data Types

Structures

NSFetch​Request​Result​Type

Constants that specify the possible result types a fetch request can return.

NSSnapshot​Event​Type

Constants returned from awake(from​Snapshot​Events:​) to denote the reason why a managed object may need to reinitialize values.

Extended Types

Cocoa​Error

Describes errors within the Cocoa error domain.

Cocoa​Error.Code

The error code itself.

NSNotification.Name

The type used for the name of a notification.