Your updateLocal() func has a sort descriptor with two of the same values: fetchRequest.sortDescriptors = [NSSortDescriptor(keyPath: \Project.name, ascending: true), NSSortDescriptor(keyPath: \Project.name, ascending: true)] - does this do anything in particular?
Anyway, you're doing an awful lot work in what should be a simple Core Data update function. Have you tried retrieving from Core Data all the projects that need updating, doing your updates to the various bits, and then saving the context in one go?
Topic:
App & System Services
SubTopic:
iCloud
Tags: