I have a CoreData model and I can insert some string as a new row. And then my NSFetchedResultsController
type return .Insert
.
But when I change my data like:
let uri = NSURL(string: "My Object ID")!
let mID = self.managedObjectContext!.persistentStoreCoordinator!.managedObjectIDForURIRepresentation(uri)
let oldM = try self.managedObjectContext!.existingObjectWithID(mID!) as! Soft
oldM.info = "New data"
Sometimes NSFetchedResultsController
does not send .Update
but sometimes it works well. What is the reason? Is any way to make a forced update to NSFetchedResultsController
?
UPDATE I tried check when this code is call
func controllerWillChangeContent(controller: NSFetchedResultsController) {
print("test 1")
}
func controllerDidChangeContent(controller: NSFetchedResultsController) {
print("test 2")
}
and this both value i have only when NSFetchedResultsController send some type .Update .Insert so i don't even update tableView, maybe i can add observe and then update my row.