this code is losing the managed object context:
func performInBackground(operation: BackgroundOperation) {
container.performBackgroundTask { context in
self.backgroundQueue.async {
operation.execute(context: context)
}
}
}
you don't need backgroundQueue. it should be this instead…
func performInBackground(operation: BackgroundOperation) {
container.performBackgroundTask { context in
operation.execute(context: context)
}
}
Topic:
App & System Services
SubTopic:
Core OS
Tags: