mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-11 20:00:30 +01:00
Updating one of objects from relationship set not triggers the objectMonitor's "didUpdateObject" method #335
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @itShouldWork on GitHub (Jul 13, 2020).
I have an object:
class Dialog: CoreStoreObject {}On some events one or many messages in dialog can be changed (message’s text etc).
I need to handle these changes via «objectMonitor» that observes the «Dialog» object, but the «didUpdateObject» method doesn’t call. As I suppose, because the «Dialog» object really hasn’t changes (there are changes only for messages). However, if I could get a notification about the change of the «Dialog» object through the "didUpdateObject" method, that would be great.
Do you have any idea how I can get this behaviour?
Thank you in advance!
@JohnEstropia commented on GitHub (Jul 16, 2020):
Relationship properties do not notify any of the observers. This is the behavior inherited from Core Data.
If you need this functionality, create a property in the parent object that gets updated whenever the child object is updated.
In your case for example, you could have a
Dialog.updatedDateproperty that can be updated whenever a reload is needed.@itShouldWork commented on GitHub (Jul 17, 2020):
Got it, thanks for the answer!
I would like to take this moment to express my deep gratitude for this framework!👏