brainray
brainray

Reputation: 12884

Realm Notification firing too fast for UI update (no fine grain notifications)

I am using a Realm notification for updating the Ui after data changes. Sometimes I want to delete certain data (say objects of class Menu) and related objects (e.g.) order. The UI only shows one Menu object at a time.

Unfortunately the UI update itself if slower than the deletion of the corresponding database items, so that the deletion end up in a race condition - and leads to a crash, because the data was deleted before the view was ready to read it.

What would be a good and easy way to get around this? I could of course count the deletions and prevent updating manually. Or could use a usual iOS Notification to handle this - but then I would have to switch back and forth between these types.

My wish would be, to have a retrigger time for the notifications - making them less nervous for UI changes. Is there something like this available?

Upvotes: 2

Views: 486

Answers (1)

segiddins
segiddins

Reputation: 4120

Realm does not currently have fine-grained notifications, but it's a features that actively being worked on! KVO support should be merged in very soon, and you can follow https://github.com/realm/realm-cocoa/issues/601 for more updates on other kinds of fine grained notifications.

Update

Realm has shipped support for fine-grained notification with version 0.99.

Upvotes: 3

Related Questions