Post

Replies

Boosts

Views

Activity

Reply to Crashing when trying to use NSFetchedResultsController fetchedObjects
I still get random EXC_BAD_ACCESS crashing in iOS 14.7 using fetchedObjects or even using object(at:).     let batch = (beforeUpdate..<afterUpdate).map { controller.object(at: .init(row: $0, section: 0)) } The weird thing right after the crash in the debugger I can access the object at that row without problem: (lldb) p controller.fetchedObjects![$0] (NSFetchRequestResult) $R9 = (object = 0x0000000280fac9b0) (lldb) p $0 (Int) $R7 = 200 (lldb) p controller.object(at: .init(row: $0, section: 0)) as? NSManagedObject (NSManagedObject?) $R6 = 0x0000000280fac9b0 {   baseCDContact@0 = { The good news is that this issue seems to be fixed in the iOS 15 beta...
Aug ’21
Reply to Why? "CloudKit integration does not support unique constraints"
Alternatively, you can use two persistent stores, one local and one CloudKit. You'll put the entities in different Configurations and add them to the same NSPersistentStoreCoordinator. The entities in the local configuration can use any Core Data features including unique constraints. You'd use persistent history and the notifications to drive importing and exporting between the two store files. This is more customizable but obviously a considerable amount of work. Do you have some example for this?
May ’21