get rid of warning with core data
This commit is contained in:
@@ -198,19 +198,14 @@ class PersistenceController {
|
|||||||
container = NSPersistentContainer(name: "Feels")
|
container = NSPersistentContainer(name: "Feels")
|
||||||
}
|
}
|
||||||
|
|
||||||
guard let description = container.persistentStoreDescriptions.first else {
|
|
||||||
fatalError("Could not retrieve a persistent store description.")
|
|
||||||
}
|
|
||||||
|
|
||||||
description.setOption(true as NSNumber, forKey: NSPersistentHistoryTrackingKey)
|
|
||||||
container.viewContext.automaticallyMergesChangesFromParent = true
|
|
||||||
|
|
||||||
for description in container.persistentStoreDescriptions {
|
for description in container.persistentStoreDescriptions {
|
||||||
description.setOption(true as NSNumber, forKey: NSPersistentStoreRemoteChangeNotificationPostOptionKey)
|
description.setOption(true as NSNumber, forKey: NSPersistentStoreRemoteChangeNotificationPostOptionKey)
|
||||||
description.setOption(true as NSNumber, forKey: NSPersistentHistoryTrackingKey)
|
description.setOption(true as NSNumber, forKey: NSPersistentHistoryTrackingKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
container.loadPersistentStores(completionHandler: { (storeDescription, error) in
|
container.loadPersistentStores(completionHandler: { (storeDescription, error) in
|
||||||
|
self.container.viewContext.automaticallyMergesChangesFromParent = true
|
||||||
|
|
||||||
if let error = error as NSError? {
|
if let error = error as NSError? {
|
||||||
fatalError("Unresolved error \(error), \(error.userInfo)")
|
fatalError("Unresolved error \(error), \(error.userInfo)")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user