Roobiq / RBQFetchedResultsController

Drop-in replacement for NSFetchedResultsController backed by Realm.
MIT License
476 stars 70 forks source link

adding an object to the database results in didChangeObject being called instead of didAddObject #44

Closed amccarri closed 9 years ago

amccarri commented 9 years ago

Looks like this was a result of the change in addOrUpdateObjectWithNotification. Correctly moved the addOrUpdateCall to before the didAdd/DidChange logic, but now since you just added it, it always exists in the database, so it always will fire didChange.

In RLMRealm+Notifications.m see addOrUpdateObjectWithNotification:

bigfish24 commented 9 years ago

Yeah that's the issue, the check should occur first and save a BOOL on which it was then, call the addOrUpdate then call the correct logger finally since it is guaranteed to be in Realm at that point.