Search results for

NSPersistentCloudKitContainer

589 results found

Post

Replies

Boosts

Views

Activity

Reply to Toggle sync with NSPersistentCloudKitContainer
How do you set the store description to nil.....I see its key/value but I tried to set it on the description after loading the store and it says its read only? // MARK: - Core Data stack lazy var persistentContainer: NSPersistentCloudKitContainer = { /* The persistent container for the application. This implementation creates and returns a container, having loaded the store for the application to it. This property is optional since there are legitimate error conditions that could cause the creation of the store to fail. */ let container = NSPersistentCloudKitContainer(name: name) container.loadPersistentStores(completionHandler: { (storeDescription, error) in {tried to set it here storeDescription.options = nil}
Sep ’19
Reply to NSPersistentCloudKitContainer Import failed (incomprehensible archive)
Our general set of debugging / inspection Tech Notes are: https://developer.apple.com/documentation/technotes/tn3163-understanding-the-synchronization-of-nspersistentcloudkitcontainer https://developer.apple.com/documentation/technotes/tn3162-understanding-cloudkit-throttles https://developer.apple.com/documentation/technotes/tn3164-debugging-the-synchronization-of-nspersistentcloudkitcontainer If you set an exception breakpoint in Xcode you can probably capture call stack where the keyed archiver exception is thrown. That, the store files from the device having issues, and a sysdiagnose would make a good feedback report for further investigation. We include instructions for capture a sysdiagnose in TN3163.
Dec ’24
Reply to NSPersistentCloudKitContainer not syncing existing data
Nick, thanks for the input.Behaviours I've noticed...Scenario 1Existing Core Data app with existing records.Log in to the same Apple ID on different Simulators or Devices.Enable NSPersistentCloudKitContainer and include container.viewContext.automaticallyMergesChangesFromParent = trueOnly new records are synced to users CloudKit account and therefore across devices using the same Apple ID. Existing records remain only on the device on which they are created.Scenario 2Existing Core Data app with existing records.Log in to the same Apple ID on different Simulators or Devices.Enable NSPersistentCloudKitContainer and include container.viewContext.automaticallyMergesChangesFromParent = trueEnable NSPersistentHistoryTrackingKey... guard let containerStoreDescription = container.persistentStoreDescriptions.first else { fatalError((#function): Failed to retrieve a persistent store description.) } containerStoreDescription.setOption(true as NSNumber, forKey: NSPersistentHistoryTrackingKey)ANY records
Dec ’19
Reply to MAJOR Core Data Issues with iOS 18 and sdk - Data Missing for many users?!
are you aware of any behavioral changes in iOS 18 that causes an NSPersistentCloudKitContainer to delete data? Not that I am aware of. To be clear, NSPersistentCloudKitContainer does clean the data on the device if it gets notified of a change on the current logged-in Apple ID, but that has been the as-designed behavior since the very beginning. Note that it only cleans the local data; the data on CloudKit is still there, and will be synchronized back when the user logs back in with the same account, and so no data loss will happen. Best, —— Ziqiao Chen  Worldwide Developer Relations.
Jan ’25
Reply to NSFileProtection confusion
Here's a working snippet: container = NSPersistentCloudKitContainer(name: YourDataModelName) container.persistentStoreDescriptions.first!.setOption(FileProtectionType.complete as NSObject, forKey: NSPersistentStoreFileProtectionKey) container.loadPersistentStores(completionHandler: { (storeDescription, error) in ...
Topic: Privacy & Security SubTopic: General Tags:
Nov ’21
Reply to iPad os 18.1 iCloud error
For folks to be able to help, you might consider providing more context about your issue, like what Apple APIs you are using, how your app uses the APIs, how you trigger the issue, what the details of the error are. The log shows Core Data got involved. Assuming you are using Core Data + CloudKit, here are the technical resources that I believe can help debug the issue: TN3162: Understanding CloudKit throttles TN3163: Understanding the synchronization of NSPersistentCloudKitContainer TN3164: Debugging the synchronization of NSPersistentCloudKitContainer Sharing Core Data objects between iCloud users Best, —— Ziqiao Chen  Worldwide Developer Relations.
Aug ’24
Getting errors when trying to connect to CloudKit using NSPersistentCloudKitContainer
I am trying to build a very basic app using Core Data and CloudKit. I am logged into my CloudKit account on my Mac, and I followed the instructions to run the sample project that Apple provided on their website.Using the sample project as a guide, I tried to build a simpler app using the instructions provided here.However, after building trying to run my sample project, I get the following error stack trace in my console:CoreData: debug: CoreData+CloudKit: -[PFCloudKitOptionsValidator validateOptions:andStoreOptions:error:](35): Validating options: <NSCloudKitMirroringDelegateOptions: 0x60000097f960> containerIdentifier:iCloud.com.cybermedia.CloudKitTest1 initializeSchema:YES ckAssetThresholdBytes:<null> operationMemoryThresholdBytes:<null> useEncryptedStorage:NO automaticallyDownloadFileBackedFutures:NO automaticallyScheduleImportAndExportOperations:YES skipCloudKitSetup:NO preserveLegacyRecordMetadataBehavior:NO useDaemon:YES apsConnectionMachServiceName:<null> containerProvider:<
5
0
7.4k
Jul ’19