I created simple NSBatchUpdateRequest
:
let bur = NSBatchUpdateRequest(entityName: "WLWishlist")
bur.predicate = NSPredicate(format: "name = %@", "oldname")
bur.propertiesToUpdate = ["name": "newname"]
bur.resultType = .UpdatedObjectsCountResultType
and then execute them:
do {
let result = try NSManagedObjectContext.MR_defaultContext().executeRequest(bur) as? NSBatchUpdateResult
print("------------- \(result!.result)")
} catch {
print("error")
}
The output on console is:
------------- Optional(6)
But my NSFetchedResultsController
which manage the same objects, does not know that sth was changed. How to inform NSFetchedResultsController
about this?