Updates the persistent properties of a managed object to use the latest values from the persistent store.
- iOS 3.0+
- macOS 10.4+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- watchOS 2.0+
- Core Data
A managed object.
A Boolean value.
objectis turned into a fault and any pending changes are lost. The object remains a fault until it is accessed again, at which time its property values will be reloaded from the store or last cached state.
objectis turned into a fault and
object’s property values are reloaded from the values from the store or the last cached state then any changes that were made (in the local context) are re-applied over those (now newly updated) values. (If
truethe merge of the values into
objectwill always succeed—in this case there is therefore no such thing as a “merge conflict” or a merge that is not possible.)
If the staleness interval (see
staleness) has not been exceeded, any available cached data is reused instead of executing a new fetch. If
true, this method does not affect any transient properties; if
false, transient properties are disposed of.
You typically use this method to ensure data freshness if more than one managed object context may use the same persistent store simultaneously, in particular if you get an optimistic locking failure when attempting to save.
object into a fault (
false) means that strong references to related managed objects (that is, those to which
object has a reference) are broken, so you can also use this method to trim a portion of your object graph you want to constrain memory usage.