tableView.reloadData in folder.didSet conflicts with tableView.deleteRows or tableView.insertRows, so the app will crash on creating or deleting folders.
Two solutions:
- Only one update strategy. Delete
tableView.deleteRows and tableView.insertRows, or call tableView.reloadData() imperatively instead of auto call in folder.didSet.
- Add a condition to
tableView.reloadData() in folder.didSet. For example, add a updatingInteractive instance variable, set to true on start of deleteItem(item:) and insert(item:) methods, set to false on end.
Project: Recordings-controller-owned-networking*
tableView.reloadDatainfolder.didSetconflicts withtableView.deleteRowsortableView.insertRows, so the app will crash on creating or deleting folders.Two solutions:
tableView.deleteRowsandtableView.insertRows, or calltableView.reloadData()imperatively instead of auto call infolder.didSet.tableView.reloadData()infolder.didSet. For example, add aupdatingInteractiveinstance variable, set totrueon start ofdeleteItem(item:)andinsert(item:)methods, set tofalseon end.Project: Recordings-controller-owned-networking*