I'm updating my current UITableview to diffable datasource provided by iOS 13 UITableViewDiffableDataSource
.
I have an array with a custom object (implementing isEqual: method). On viewWillAppear I load the data from disk and call apply for snapshot.
-(void)updateTableViewAnimated:(BOOL)animated API_AVAILABLE(ios(13.0)){
NSDiffableDataSourceSnapshot *snapshot = [[NSDiffableDataSourceSnapshot alloc]init];
[snapshot appendSectionsWithIdentifiers:@[@"sectionTitle"]];
[snapshot appendItemsWithIdentifiers:self.playlists];
[self.diffDataSource applySnapshot:snapshot animatingDifferences:animated];
}
And everything loads. But when a try to delete an item from the array and call again updateTableViewAnimated:
, I get an exception.
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Inconsistent associations for moves'
What does it mean? How can I solve?