Returns a value as appropriate for the given request, or nil if the request cannot be completed.
- iOS 5.0+
- macOS 10.7+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- watchOS 2.0+
- Core Data
A fetch request.
The managed object context used to execute
If an error occurs, on return contains an
NSErrorobject that describes the problem.
A value as appropriate for
nil if the request cannot be completed
The value to return depends on the result type (see
If it is
Object Result Type
Object IDResult Type
NSDictionary, the method should return an array containing all objects in the store matching the request.
If it is
NSCount, the method should return an array containing an
NSNumberwhose value is the count of of all objects in the store matching the request.
If the request is a save request, the method should return an empty array.
If the save request contains nil values for the inserted/updated/deleted/locked collections; you should treat it as a request to save the store metadata.
You should implement this method conservatively, and expect that unknown request types may at some point be passed to the method. The correct behavior in these cases is to return
nil and an error.