Instance Property


The set of objects that will be removed from their persistent store during the next save operation.


@property(nonatomic, readonly, strong) NSSet<__kindof NSManagedObject *> *deletedObjects;


The returned set does not necessarily include all the objects that have been deleted (using deleteObject:)—if an object has been inserted and deleted without an intervening save operation, it may not be included in the set.

A managed object context does not post key-value observing notifications when the return value of deletedObjects changes. A context does, however, post a NSManagedObjectContextObjectsDidChangeNotification notification when a change is made, and a NSManagedObjectContextWillSaveNotification notification and a NSManagedObjectContextDidSaveNotification notification before and after changes are committed respectively (although again the set of deleted objects given for an NSManagedObjectContextDidSaveNotification does not include objects that were inserted and deleted without an intervening save operation—that is, they had never been saved to a persistent store).

See Also

Managing Managed Objects


A Boolean value that indicates the behavior of inaccessible faults.


The set of objects that have been inserted into the context but not yet saved in a persistent store.


The set of objects registered with the context that have uncommitted changes.

- insertObject:

Registers an object to be inserted in the context’s persistent store the next time changes are saved.

- deleteObject:

Specifies an object that should be removed from its persistent store when changes are committed.

- assignObject:toPersistentStore:

Specifies the store in which a newly inserted object will be saved.

- obtainPermanentIDsForObjects:error:

Converts to permanent IDs the object IDs of the objects in a given array.

- detectConflictsForObject:

Marks an object for conflict detection.

- refreshObject:mergeChanges:

Updates the persistent properties of a managed object to use the latest values from the persistent store.

- processPendingChanges

Forces the context to process changes to the object graph.

- observeValueForKeyPath:ofObject:change:context:

Allows a context that has registered as an observer of a value to be notified of a change to that value.

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