Questions tagged [nspersistentcloudkitcontainer]

111 questions
4
votes
0 answers

Core Data + CloudKit Migration: Cannot create or modify field [...] in record [...] in production schema

I use NSPersistentCloudKitContainer to sync Core Data with Cloud Kit. To prepare for a new migration, I have created a new model version of the xcdatamodel and marked it as "current". I created a new entity and added a relationship from another…
4
votes
0 answers

Mirroring Shared data CoreData + CloudKit

I've set up Core Data mirroring using NSPersistentCloudKitContainer and it works well. I also managed how to create share for records. But how I can get shared record synced with the non-owner's Core Data? Example: User A (owner) shared record with…
bodich
  • 1,708
  • 12
  • 31
4
votes
0 answers

Migrating NSPersistentCloudKitContainer to AppGroup causes CloudKit to re sync and create duplicate objects

I have a CoreData store using NSPersistentCloudKitContainer within the app. When I migrate it to the AppGroup it thinks that it hasn't performed a sync before so re syncs all CKRecords down to the database, which then means there are duplicate…
4
votes
1 answer

Toggle iCloud sync during runtime

I have a SwiftUI App, where the user can buy with in-app purchases some premium features. One of this features is iCloud sync over more devices. I am using CoreData to save users data. My persistent container: lazy var persistentContainer:…
Leahpar
  • 583
  • 1
  • 4
  • 12
3
votes
1 answer

Core Data Version Migration with iCloud

I have a Core Data app in production and would like to add attributes to existing entities. After research, I found that this is a "lightweight migration," and just need to add NSMigratePersistentStoresAutomaticallyOption and…
3
votes
1 answer

NSPersistentCloudKitContainer: Share a single database with App Extension

I know this is a common question, maybe it is so many time asked before. Also I know how to share a single database with App Extensions using Core Data by enabling App Groups. I am now using the NSPersistentCloudKitContainer to sync the data (across…
3
votes
1 answer

CloudKit NSPersistentCloudKitContainer push notifications not working

I'm struggling to solve the following problem. Notwithstanding an in-depth search I did not succeed yet. My development environment is Xcode 12.0 beta under macOS Big Sur Beta (however, the problem appears identical on Xcode 11.5 under Catalina). My…
3
votes
2 answers

CoreData + CloudKit but No sharing

CoreData is pretty awesome. It makes coding a persistent store with a SQLite DB quite predictable. CloudKit is pretty awesome. It makes coding a persistent store in iCloud easy and shareable between a user's devices. CoreData + CloudKit are doubly…
3
votes
0 answers

No child records in Shared Database for parent record using NSPersistentCloudKitContainer

I've set up a Core Data mirroring to CloudKit using NSPersistentCloudKitContainer. My simplified data structure consists of List and Item. List have one-to-many relationship items with many Items, Item has parentList property. When I am getting…
bodich
  • 1,708
  • 12
  • 31
3
votes
2 answers

Core Data+CloudKit not connecting to CloudKit

I am updating a pre-iOS13 Core Data app to use Core Data+CloudKit syncing to support single users on multiple devices. The syncing is supposed to occur automagically, and in an interim step in my development it did work. Now it's not working, with…
tkhelm
  • 345
  • 3
  • 14
3
votes
1 answer

Getting NSPersistentCloudKitContainer Changes in the background to set notifcations

I have added date triggered local notifications to my app and now I want the user to be able to get the notification they set on one device on all of their devices that have the app. I save the notification they set in a core data entity (saving the…
ap123
  • 916
  • 1
  • 8
  • 22
3
votes
0 answers

How to debug Core Data Cloudkit crash on macOS app

I have a Core data iOS app which uses Cloudkit using NSPersistentCloudkitContainer - iOS 13 onwards. I have tested it on an iPad and iPhone and the sync works well. I have now tried to add Cloudkit to a similar Mac app using the same Cloudkit…
3
votes
1 answer

Record uniqueness when using NSPersistentCloudKitContainer?

I have successfully migrated my app to use NSPersistentCloudKitContainer in order to have its data synchronised using CloudKit. However, I am wondering how I should deal with uniqueness of certain entities. For example, assume a User entity that has…
3
votes
1 answer

NSPersistentCloudKitContainer losing data

I'm using NSPersistentCloudKitContainer in my app in production but some of my users are informing me that data is missing after updating to recent version which introduced NSPersistentCloudKitContainer. For majority of my users it's working without…
Wojtek
  • 1,006
  • 11
  • 30
3
votes
1 answer

Getting error stack trace when working NSPersistentCloudKitContainer in iOS

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,…
syedfa
  • 2,801
  • 1
  • 41
  • 74