You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am trying to delete a row from my table using .delete editStyle and the app is crashing due to Fatal error: Index out of range. By the looks of it the datasource gets updated before the tableView finishes editing and director tries to access model at indexPath(in didEndEditingRowAt: method) which was already deleted.
To reproduce the issue - add the lines below into CatalogViewController of OwlDemo app.
What's the correct way to delete a row from a table?
Hi, Thank you for your report.
I've just fixed this issue but in order to correctly receive events for end editing model and cell you mus enclose the function inside an editing session:
That's the code:
catalogAdapter.events.commitEdit ={[weak self] ctx, style in
guard let indexPath = ctx.indexPath else{return}self?.tableDirector?.reload(afterUpdate:{ dir in
dir.sections[indexPath.section].remove(at: indexPath.row)returnUITableView.RowAnimation.none
}, completion:nil)}
Hi,
I am trying to delete a row from my table using .delete editStyle and the app is crashing due to
Fatal error: Index out of range
. By the looks of it the datasource gets updated before the tableView finishes editing and director tries to access model at indexPath(indidEndEditingRowAt:
method) which was already deleted.To reproduce the issue - add the lines below into CatalogViewController of OwlDemo app.
What's the correct way to delete a row from a table?
The text was updated successfully, but these errors were encountered: