You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 8, 2023. It is now read-only.
CoreData doesn't call willSave for newly inserted objects. So many of my projects include this "fix", maybe CoreDataKit could include this as a optional fix that you can enable?!
// Apply "fix" so willSave is also called for inserted objects
NSNotificationCenter.defaultCenter().addObserverForName(NSManagedObjectContextWillSaveNotification, object: nil, queue: NSOperationQueue.mainQueue()) { notification in
if let managedObjectContext = notification.object as? NSManagedObjectContext {
for managedObject in managedObjectContext.insertedObjects {
managedObject.willSave()
}
}
}