Reputation: 346
I can't understand what's wrong with code.
I use native method for final merge context.
@objc func mergeContext(notification: Notification) {
let sender = notification.managedObjectContext
if sender != mainThreadManagedObjectContext {
mainThreadManagedObjectContext.performAndWait {
[unowned self] in
self.mainThreadManagedObjectContext.mergeChanges(fromContextDidSave: notification)
}
}
}
Upvotes: 0
Views: 487
Reputation: 51892
Here Notification clearly is a subclass of NSManagedObject
let sender = notification.managedObjectContext
but this method mergeChanges(fromContextDidSave:)
expects a swift class Notification
so you are probably calling the wrong function
Upvotes: 3