Post

Replies

Boosts

Views

Activity

Reply to Potential problem with synching users' private CloudKit with NSPersistentCloudKitContainer
Yes. the current design of NSPersistentCloudKitContainer is to sync everything. There are other sync engines available between CoreData and CloudKit, such as CKSyncEngine in iOS 17, and open source sun engines like CloudCore, which might provide more fine-grain control over sync. And of course, you can always write your own that best suits your needs.
Jul ’23
Reply to User Name components
unfortunately, I have written ton of functionality based on the CloudKit DiscoverUser functionality, and it all appears to be deprecated in iOS 17, with no new APIs to replace them. The sample code "Sharing CloudKit Data with Other iCloudUsers" doesn't address this at all.
Jul ’23
Reply to NSPersistentCloudKitContainer CKRecord conversion errors
it sure does look like CloudKit is trying to push a record containing an unidentified field: "Cannot create or modify field 'CD_data_ckAsset' in record 'CD_ImageData' in production schema" While you may think all your image files are < 1Mb, Core Data may still be using external files in some edge cases. You could run your app in dev mode, add a very large image > 1mb, and have it sync, then see if there are schema changes to be pushed from dev to prod?
Jul ’23
Reply to Swift UI + Core Data in a background thread?
As you have discovered, you cannot ignore the threading requirements of CoreData or SwiftUI. If you retrieve objects in a background context/thread, you cannot access them in the main thread (ie SwiftUI). How many FRCs are you instantiating? Can you do updates with one set of FRCs in background contexts, and then use another set in the viewContext? Have you tried setting the batching levels on your FRCs?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’23
Reply to Core Data and FetchedResultsController bugged behaviour after application crash (or forced exit)
this code is losing the managed object context: func performInBackground(operation: BackgroundOperation) { container.performBackgroundTask { context in self.backgroundQueue.async { operation.execute(context: context) } } } you don't need backgroundQueue. it should be this instead… func performInBackground(operation: BackgroundOperation) { container.performBackgroundTask { context in operation.execute(context: context) } }
Topic: App & System Services SubTopic: Core OS Tags:
May ’23