Instance Method

insertObject:

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

Declaration

- (void)insertObject:(NSManagedObject *)object;

Parameters

object

A managed object.

Discussion

The managed object (object) is registered in the receiver with a temporary global ID. It is assigned a permanent global ID when changes are committed. If the current transaction is rolled back (for example, if the receiver is sent a rollback message) before a save operation, the object is unregistered from the receiver.

See Also

Managing Managed Objects

shouldDeleteInaccessibleFaults

A Boolean value that indicates the behavior of inaccessible faults.

insertedObjects

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

updatedObjects

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

deletedObjects

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

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