Refresh all objects: Merging changes?

NSManagedObjectContext has a method called refreshAllObjects() but it's not clear what effect it's supposed to have. The docs say nothing, and header comments include a line that says it "calls -refreshObject:mergeChanges: on all currently registered objects with this context".


OK. But. When calling refresh(NSManagedObject, mergeChanges: Bool), the second argument matters. Passing "true" has a different effect than passing "false".


Which of these does refreshAllObjects() use?

Answered by NotMyName in 263116022

According to the WWDC video, this is what refreshAllObjects does:


refreshAllObjects
This refreshes all the objects in the context while preserving the unsaved changes. The references will remain valid and it will break any retain cycles that may have been inadvertently created.


That corresponds to the True option, if I'm reading it right.

Accepted Answer

According to the WWDC video, this is what refreshAllObjects does:


refreshAllObjects
This refreshes all the objects in the context while preserving the unsaved changes. The references will remain valid and it will break any retain cycles that may have been inadvertently created.


That corresponds to the True option, if I'm reading it right.

Thanks, that seems pretty clear. I had not found it in the video.

Refresh all objects: Merging changes?
 
 
Q