Contents

objectID(for:withReferenceObject:)

Returns a managed object ID from the reference data for a specified entity.

Declaration

func objectID(for entity: NSEntityDescription, withReferenceObject data: Any) -> NSManagedObjectID

Parameters

  • entity:

    An entity description object.

  • data:

    Reference data for which the managed object ID is required.

Return Value

The managed object ID from the reference data for a specified entity

Discussion

You use this method to create managed object IDs which are then used to create cache nodes for information being loaded into the store.

Special Considerations

You should not override this method.

See Also

Loading a Store