Returns the object for the specified ID or nil if the object does not exist.
- iOS 3.0+
- macOS 10.6+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- watchOS 2.0+
The object ID for the requested object.
If there is a problem in retrieving the object specified by
objectID, upon return contains an error that describes the problem.
The object specified by
objectID. If the object cannot be fetched, or does not exist, or cannot be faulted, it returns
If there is a managed object with the given ID already registered in the context, that object is returned directly; otherwise the corresponding object is faulted into the context.
This method might perform I/O if the data is uncached.
objectWithID:, this method never returns a fault.
Registering and Fetching Objects
Returns the number of objects a given fetch request would have returned if it had been passed to
Returns an object for a specified ID even if the object needs to be fetched.
Passes a request to the persistent store without affecting the contents of the managed object context and returns a persistent store result.
Refreshes all currently registered objects that are associated with this context.
A Boolean value that indicates whether the context keeps strong references to all registered managed objects.
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