Reputation: 175
Realm query emit items on each write operation. Even if the same data as stored in realm was written.
Upvotes: 0
Views: 30
Reputation: 81539
Even if the same data as stored in realm was written.
Realm knows that you made a write operation to a given object, and that a given property was set to a given value.
And it also can't know that you "didn't mean to do a write", similarly to how if you write null
or 0
as a value, it can't know you "didn't intend to set this value".
So the solution is that if you want to control your writes, then you should do it by hand: don't call the setter if the value is equal to that of the managed object's.
Upvotes: 1