Questions tagged [nspersistentcloudkitcontainer]

111 questions
2
votes
0 answers

NSPersistentCloudKitContainer not syncing data on macOS

I am using NSPersistentCloudKitContainer to share data between iOS and macOS app. I have set up the project according to the official tutorials. And when I made changes from the macOS app, the lastest data will automatically display on my iOS app.…
2
votes
1 answer

Storing some entities only locally when using NSPersistentCloudKitContainer

What I want to achieve is that I have a Core Data configuration that syncs with CloudKit and a configuration that does not get synced. There are some entities I don't want to sync. They should be stored locally only. I've tried to create a separate…
gpichler
  • 2,181
  • 2
  • 27
  • 52
2
votes
1 answer

How to detect that iOS App was launched for first time by specific user (not on specific device)?

I am using in my App cloudKit + Core Data in my App (iOS 13+) (swift). I cannot figure out how to detect very first run of the app regardless of device to initialize some default data. There are many posts how to detect first launch of a iOS app…
2
votes
1 answer

Can you share data with NSPersistentCloudKitContainer between multiple apps?

So my question is as written in the title if you could use NSPersistentCloudKitContainer to share data between different apps like if you have a different app for iPad, a different one for iPhone and a different one for Mac and if possible how would…
David
  • 148
  • 1
  • 1
  • 8
1
vote
0 answers

NSPersistentCloudkitContainer Public Database doesn't sync at all

I have one view which fetches data from a private database with following code to fetch all private items: @Environment(\.managedObjectContext) private var viewContext @FetchRequest( sortDescriptors: [NSSortDescriptor(keyPath:…
1
vote
1 answer

CloudKit integration requires that all attributes be optional, or have a default value set. Does not detect default UUID value

I am writing an app which is backed by CoreData with CloudKit integration. I have a few non-optional things in my model and provided default values for them (a few numbers which logically would default to 0 anyway). I also have an id associated with…
1
vote
1 answer

NSPersistentCloudKitContainer throwing debug / error messages

Overview When I use NSPersistentCloudKitContainer I get the following error / debug messages printed on the Xcode Debug Area. I have logged into iCloud and I am testing on device Syncing seems to happen fine I am still using Development (not…
user1046037
  • 16,755
  • 12
  • 92
  • 138
1
vote
2 answers

Core Data + Cloud Kit - data record type does not appear in CloudKit Dashboard

I created a blank SwiftUI project in XCode and selected to include Core Data and Cloud Kit. By default, Apple already included some Core Data sample code and entities in the project, and also a Persistence.swift file that contained…
1
vote
1 answer

I have 2 iOS apps, 2 CloudKit containers, and 1 app needs access to both CloudKit containers. Advice?

I have 2 apps in the App Store, and each uses the private database in its own CloudKit container. (ie, App1 uses “iCloud.com.company.App1” and App2 uses “iCloud.com.company.App2”) I want to add a feature to App2 which will require App2 to read/write…
Koa
  • 173
  • 8
1
vote
1 answer

CoreData + CloudKit Data Inconsistency after Network Failure

My app uses CoreData + CloudKit mirroring to synchronize data e.g. on an iPhone and a watch. If data is modified on one device, the modification is uploaded to iCloud and later synchronized with other devices. This works normally fine. However very…
1
vote
1 answer

Core Data sharing with CloudKit: Unable to Accept Share

I had my app working with Core Data, then CloudKit to sync between devices and now I'd like to share data between users. I watched both Build apps that share data through CloudKit and Core Data and What's new in CloudKit WWDC21 and thought that I…
Austin E
  • 823
  • 1
  • 9
  • 22
1
vote
0 answers

How to handle deduplication with CoreData and CloudKit?

I can't find any updated tutorials on CloudKit with CoreData + SwiftUI. CloudKit does not support constraints then how do I merge duplicate records for my case? I need to know what to do now that I had to disable CoreData constraints and the merge…
1
vote
0 answers

CloudKit: how to handle CKError partialFailure when using NSPersistentCloudKitContainer?

I'm using NSPersistentCloudKitContainer with Core Data and I receive errors because my iCloud space is full. The errors printed are the following:
alpennec
  • 1,864
  • 3
  • 18
  • 25
1
vote
1 answer

Getting "Custom zones are not allowed in public DB" since Xcode 13 / iOS15

First post here, and desperate for help. I am hitting an issue when developing an app that uses the CloudKit Public DB. I am relatively new to this, and I may be doing something wrong. I have distilled the issue to use just the template app that…
1
vote
1 answer

Core Data + CloudKit syncing very inconsistently

I have an app in production using Core Data + CloudKit, synced using the built in NSPersistentCloudKitContainer. It works perfectly well most of the time, but sometimes it simply won't sync with no errors or anything. Some users report that it works…
Miles
  • 487
  • 3
  • 12