Instance Property

includesPendingChanges

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

Declaration

@property(nonatomic) BOOL includesPendingChanges;

Discussion

This value is YES if when the fetch is executed, the fetch will match against currently unsaved changes in the managed object context; otherwise the value is NO. The default value is YES.

If the value is NO, the fetch request doesn't check unsaved changes and only returns objects that matched the predicate in the persistent store.

Special Considerations

A value of YES is not supported in conjunction with the result type NSDictionaryResultType, including calculation of aggregate results (such as max and min). For dictionaries, the array returned from the fetch reflects the current state in the persistent store, and does not take into account any pending changes, insertions, or deletions in the context.

If you need to take pending changes into account for some simple aggregations like max and min, you can instead use a normal fetch request, sorted on the attribute you want, with a fetch limit of 1.

See Also

Managing How Results Are Returned

resultType

The result type of the fetch request.

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.

includesPropertyValues

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

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.