Xcode error throwing fatalError

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?

+4
source share

Source: https://habr.com/ru/post/1690778/


All Articles