realm-swift: Default Realm not updating quickly enough causing TableView assertion to trigger.
Hi, I am performing a delete operation on an object inside a realm, on a serial background thread.
I am performing the after a function callback is completed synchronously.
// delete realm object on separate thread using id to retrieve the realm object
// completed synchronously...
[self.db saveObject:t withCompleteBlock:^(BOOL complete) {
[weakSelf.tableView beginUpdates];
[weakSelf.tableView deleteRowsAtIndexPaths:self.indexPathes withRowAnimation:UITableViewRowAnimationLeft];
[weakSelf.tableView endUpdates];// Crashes here
}];
Upon checking how many objects are left inside the RLMResults array, it concludes that the object was not removed between begin and end updates.
So why does realm not delete the object right away atomically ?
The reason is crashes is, that the tableView expects count of the tasks
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 23 (11 by maintainers)
Ahhh I understand I was thinking that as well, I called refresh in the background thread instead of before the begin updates and end updates, thats probably why it didn’t work let me try this again.