A Boolean value that indicates whether, when the fetch is executed, property data is obtained from the persistent store.
- iOS 3.0+
- macOS 10.5+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Core Data
This value is
true if when the fetch is executed, property data is obtained from the persistent store; otherwise it is
false. The default value is
You can set
false to avoid creating objects to represent property values and thereby reduce memory overhead. You typically should only do so, however, if you are sure that you will not need the actual property data, or you already have the information in the row cache. Otherwise, you will incur multiple trips to the database.
During a normal fetch (
true), Core Data fetches the object ID and property data for the matching records, fills the row cache with the information, and returns managed objects as faults (see
returns). Although these faults are managed objects, all of their property data still resides in the row cache until the fault is fired. When the fault is fired, Core Data retrieves the data from the row cache—there is no need to go back to the database.
false, then Core Data fetches only the object ID information for the matching records—it does not populate the row cache. Core Data still returns managed objects because it only needs managed object IDs to create faults. However, if you subsequently fire the fault, Core Data looks in the (empty) row cache, doesn't find any data, and then goes back to the store a second time for the data.
result is set to
managed, the properties are fetched even though they are not being presented to the application and can result in a significant performance penalty.