Converts to permanent IDs the object IDs of the objects in a given array.
- iOS 3.0+
- macOS 10.5+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Core Data
An array of managed objects.
If an error occurs, upon return contains an
NSErrorobject that describes the problem.
YES if permanent IDs are obtained for all the objects in
This method converts the object ID of each managed object in
objects to a permanent ID. Although the object will have a permanent ID, it will still respond positively to
inserted until it is saved. Any object that already has a permanent ID is ignored.
Any object not already assigned to a store is assigned based on the same rules Core Data uses for assignment during a save operation (first writable store supporting the entity, and appropriate for the instance and its related items).
This method results in a transaction with the underlying store which changes the file’s modification date.
In macOS, this results an additional consideration if you invoke this method on the managed object context associated with an instance of
NSPersistent. Instances of
NSDocument need to know that they are in sync with the underlying content. To avoid problems, after invoking this method you must therefore update the document’s modification date (using