In a table, I have 3 indexes which calls each a function. In each function, there is an add button that adds data into CoreData. First 2 works, but when i press the 3rd inde
I faced the same error. I was using the delegate of NSFetchedResultsControllerDelegate. I comment rest of the delegate except the below one.
func controllerDidChangeContent(_ controller: NSFetchedResultsController) {
self.tableView.reloadData()
if self.fetchedResultsController.fetchedObjects?.count == 0 {
} else {
}
}
If you want to use all delegate then you need properly manage rows and section. This error occur when you don't manage rows and section properly.