Closed anohren closed 8 years ago
@anohren you will need to manually refresh the objects because if the object is on a different thread, there is no guarantee that when the FRC is done that other thread will have received and responded to the refresh that was triggered by the commit on your serial queue.
Short answer your way of removing the problem is the correct way to ensure the object is up-to-date.
Hi,
I'm getting all the necessary notifications for updated objects in
controllerDidChangeObject
, but the updated property of the object is not in sync with what was written on my serial dispatch queue (for database operations).If I do a
try! Realm().refresh()
incontrollerDidChangeObject
-- e.g. whenever the change type isUpdated
-- the problem goes away.I might add that the same property is written to twice in quick succession in different tasks on the same serial queue, and that in
controllerDidChangeObject
the second write appears as if it were the first write. I currently keep strong references to all the realm objects in the FRC and I'm assuming they will be up-to-date incontrollerDidChangeObject
.