Post

Replies

Boosts

Views

Activity

Intermittent crash when saving to Core Data
We are experiencing intermittent crashes when saving Core Data in an application that uses two peripherals connected via Core Bluetooth. I could really use some assistance to understand the crash log here. For some reason it seems that the following code crashes on try context.save(), which is strange since it is in a try block: func saveContext (_ inContext: NSManagedObjectContext? = nil) { if let context = inContext { if context.hasChanges { do { try context.save() } catch { let nserror = error as NSError debugPrint("Failed to load persistant store: \(nserror), \(nserror.userInfo)") } } ... Crash log
2
2
3.5k
Dec ’21