iOS 9 – “attempt to delete and reload the same index path”

This seems to be a bug in iOS 9 (which is still beta) and is also discussed in the Apple Developer Forum

  • iOS 9 CoreData NSFetchedResultsController update causes blank rows in UICollectionView/UITableView

I can confirm the problem with the iOS 9 Simulator from Xcode 7 beta 3.
I observed that for an updated managed object, the didChangeObject: delegate method is called twice: Once with the NSFetchedResultsChangeUpdate event and then again with the NSFetchedResultsChangeMove event (and indexPath == newIndexPath).

Adding an explicit check for indexPath != newIndexPath
as suggested in the above thread seems to solve the problem:

        case .Move:
            if indexPath != newIndexPath {
                tableView.deleteRowsAtIndexPaths([indexPath!], withRowAnimation: .Fade)
                tableView.insertRowsAtIndexPaths([newIndexPath!], withRowAnimation: .Fade)
        }

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)