Instance Method


Returns a new object ID that uses given data as the key.


- (NSManagedObjectID *)newObjectIDForEntity:(NSEntityDescription *)entity referenceObject:(id)data;



The entity for the new object ID.


An object of type NSString or NSNumber to use as the key.

Return Value

A new object ID for an instance of the entity specified by entity and that uses data as the key.


You should not override this method.

See Also

Manipulating Managed Objects

- executeRequest:withContext:error:

Returns a value as appropriate for the given request, or nil if the request cannot be completed.

- newValuesForObjectWithID:withContext:error:

Returns an incremental store node encapsulating the persistent external values of the object with a given object ID.

- newValueForRelationship:forObjectWithID:withContext:error:

Returns the relationship for the given relationship of the object with a given object ID.

- obtainPermanentIDsForObjects:error:

Returns an array containing the object IDs for a given array of newly-inserted objects.

- referenceObjectForObjectID:

Returns the reference data used to construct a given object ID.

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