A compact, universal identifier for a managed object.


@interface NSManagedObjectID : NSObject


This identifier 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.

Object IDs can be transformed into a URI representation which can be archived and recreated later to refer back to a given object (using managedObjectIDForURIRepresentation: (NSPersistentStoreCoordinator) and objectWithID: (NSManagedObjectContext). For example, the last selected group in an application could be stored in the user defaults through the group object’s ID. You can also use object ID URI representations to store “weak” relationships across persistent stores (where no hard join is possible).


Getting Managed Object ID Information


The entity description associated with the object ID.


A Boolean value that indicates whether the object ID is temporary.


The persistent store that fetched the object for the object ID.

- URIRepresentation

Returns a URI that provides an archiveable reference to the object for the object ID.


Inherits From

Conforms To

See Also

Inspecting Entities and Configurations


The entities in the model.


The entities of the model, keyed by name.


All the available configuration names of the model.

- entitiesForConfiguration:

Returns the entities of the model for a specified configuration.

- setEntities:forConfiguration:

Associates the specified entities with the model using the given configuration name.


A description of an entity in Core Data.


A description of an attribute of a Core Data entity.


A description of a property of a Core Data entity.


A description of a relationship of a Core Data entity.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software