static func saveContext (context: NSManagedObjectContext = getContext()) {
if context.hasChanges {
do {
try context.save()
} catch let nserror as NSError {
fatalError("Unresolved error \(nserror), \(nserror.userInfo)")
}
}
}
(I throw it to maintain the context of CoreData)
When I run fatalError Xcode, it crashes every time, and I have to open it again.
Can anyone know how to fix this or something is wrong?
source
share