Search results for

NSPersistentCloudKitContainer

589 results found

Post

Replies

Boosts

Views

Activity

Reply to NSPersistentCloudKitContainer not syncing existing data
Just utilizing the container doesn't enable the sync. You have to add/request the capabilities throuigh your plist file (iCloud under capabilities, may require background too, but i'm unsure). Pretty sure you need remote notifications as well. I read on a blog somewhere a step by step to get it working, but I haven't found 'Official' instructions for anything more than the class declaration yet. I 'think' I googled NSPersistentCloudKitContainer and tutorial.. or maybe getting started.
Jul ’19
NSPersistentCloudKitContainer not syncing existing data
I'm running into trouble setting up sync using NSPersistentCloudKitContainer on an existing app. The app doesn't seem to sync data that was added to Core Data prior the app's iOS 13 update. For instance:1. I install an existing, pre-iOS 13, version of the app and create several records that are stored in Core Data.2. Over that existing install, I install the updated version that uses NSPersistentCloudKitContainer and create some additional new records.3. I install the same new version on a second device.Results: Records created in step 1 don't appear on the second device, but records created in step 2 do.Is there a step I'm missing in order to get existing data to sync? I'm wondering if this has something to do with the persistent history token, but I'm unsure how to tell NSPersistentCloudKitContainer it should start over on first launch.
22
0
15k
Jul ’19
Can't change NSPersistentContainer into NSPersistentCloudKitContainer
I want my exiting project that's using Core Data to enable it use NSPersistentCloudKitContainer.So I set up my project as below documentation Setting Up Core Data with CloudKit says.https://developer.apple.com/documentation/coredata/mirroring_a_core_data_store_with_cloudkit/setting_up_core_data_with_cloudkitBut if I change NSPersistentContainer into NSPersistentCloudKitContainer an error occures.The error message is Use of undeclared type 'NSPersistentCloudKitContainer'.Why this happen?Are there anyone who can solve this problem?Please help me.Thanks in advance.
1
0
933
Jul ’19
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
Toggle sync with NSPersistentCloudKitContainer
Is there a way to pause or disable syncing via NSPersistentCloudKitContainer at runtime? I want to give my users the option to enable or disable syncing, but there doesn't seem to be a good way to do it. I tried reloading the persistent stores and setting the store description's cloudKitContainerOptions to nil, but if I do that after first initialization, I get an error:error: Store opened without NSPersistentHistoryTrackingKey but previously had been opened with NSPersistentHistoryTrackingKey - Forcing into Read Only modeAnyone know of another way to do this?I submitted a request via Feedback Assistant for a flag to enable or disable syncing (FB6156182). I know the user could theoretically go into the Settings app and enable or disable iCloud access for the app as a whole, but that's not very discoverable, and disables all iCloud access. I'm looking for something a little more fine-grained (limited to the NSPersistentCloudKitContainer) and that I could control in my app's UI.
15
0
15k
Jun ’19
Reply to NSPersistentCloudKitContainer for Shares
The presenter at WWDC 2019 (Nick Gillett) mentioned that Apple maintains a custom Zone in the private database (around 10:50 in the video).Since records get saved in the private database, I would think that CKShares and NSPersistentCloudKitContainer are a no-go combo.But, according to Apple's documentation, you can access the CKRecord for a specific managed object using dedicated methods, which will allow you to create CKShares: https://developer.apple.com... So I am confused.
Topic: App & System Services SubTopic: Core OS Tags:
Jun ’19
NSPersistentCloudKitContainer can't get record from NSManagedObjectId
I try to figure out if it's possible to share a users core data events in one app, to another user with CKShare and CKRecord.I got the device sync up and running and can see the changes, also CloudKit dashboard has published the changes to production.However, when I have my NSManagedObject that I got either local or from another device, I try to call the following:let myEvent: // NSManagedObject from core datalet container: NSPersistentCloudKitContainer = AppDelegate.shared.containerlet record = container.record(for myEvent.objectID // not working// record is always nilThe receord is always nil, why?And is is possible to later pass the CKRecord in a UICloudSharingController to share it to another user?
4
0
1.6k
Jun ’19
Reply to NSPersistentCloudKitContainer for Shares
I've been waiting on CloudKit + CoreData integration for a while, and I don't see how NSPersistentCloudKitContainer can't be used to share. Zero of my users has asked to sync the data between devices, everyone wants to share it between users, and how is such a core feature missing?Have to say, I'm not sure if it's missing because I can't find any documentation or tutorials, but it sure looks that way!
Topic: App & System Services SubTopic: Core OS Tags:
Jun ’19
Reply to Questions About Updating Older Core Data / iCloud App to Core Data / CloudKit
Once I have the path, I plan to do this.lazy var persistentContainer: NSPersistentCloudKitContainer = { let container = NSPersistentCloudKitContainer(name: “MyAppName”) // Create a store description for a CloudKit-backed local store let cloudStoreLocation = URL(fileURLWithPath: Original or Ubiquity Path) let cloudStoreDescription = NSPersistentStoreDescription(url: cloudStoreLocation) cloudStoreDescription.configuration = Cloud // Set the container options on the cloud store cloudStoreDescription.cloudKitContainerOptions = NSPersistentCloudKitContainerOptions( containerIdentifier: com.my.container) // Update the container's list of store descriptions container.persistentStoreDescriptions = [ cloudStoreDescription, ] // Load store container.loadPersistentStores { storeDescription, error in guard error == nil else { fatalError(Could not load persistent stores. (error!)) } } return container}()
Jun ’19