Instance Property

includesPropertyValues

A Boolean value that indicates whether, when the fetch is executed, property data is obtained from the persistent store.

Declaration

@property(nonatomic) BOOL includesPropertyValues;

Discussion

This value is YES if when the fetch is executed, property data is obtained from the persistent store; otherwise it is NO. The default value is YES.

You can set includesPropertyValues to NO 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 (includesPropertyValues is YES), 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 returnsObjectsAsFaults). 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.

If includesPropertyValues is NO, 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.

If includesPropertyValues is YES and resultType is set to NSManagedObjectIDResultType, the properties are fetched even though they are not being presented to the application and can result in a significant performance penalty.

See Also

Managing How Results Are Returned

resultType

The result type of the fetch request.

includesPendingChanges

A Boolean value that indicates whether, when the fetch is executed, it matches against currently unsaved changes in the managed object context.

propertiesToFetch

A collection of either property descriptions or string property names that specify which properties should be returned by the fetch.

returnsDistinctResults

A Boolean value that indicates whether the fetch request returns only distinct values for the fields specified by propertiesToFetch.

shouldRefreshRefetchedObjects

A Boolean value that indicates whether the property values of fetched objects will be updated with the current values in the persistent store.

returnsObjectsAsFaults

A Boolean value that indicates whether the objects resulting from a fetch request are faults.

NSFetchRequestResultType

Constants that specify the possible result types a fetch request can return.

NSFetchRequestResult

An abstract protocol used with parameterized fetch requests.