Questions tagged [nspersistentcloudkitcontainer]
111 questions
31
votes
2 answers
NSPersistentCloudKitContainer: How to check if data is synced to CloudKit
I have implemented NSPersistentCloudKitContainer to get my data synced to CloudKit, I would like to know that the sync is finished and there is no other change pending to be synced.
When I tried reinstalling the app, I start getting my data back…

FE_Tech
- 1,534
- 13
- 25
18
votes
1 answer
Migrating Data to App Groups Disables iCloud Syncing
I am adding a Today Extension to my existing app. I have added the an App Group and used this post to successfully migrate my Core Data's data to the App Group's store. My app uses both a NSPersistentCloudKitContainer (when iCloud is toggled on) and…

ap123
- 916
- 1
- 8
- 22
18
votes
1 answer
Disable CloudKit debugging logs
I am using a NSPersistentCloudKitContainer for the database in my iOS app. By default it seems to log all events to the console, I am assuming for debugging purposes. These messages look like this:
CoreData: CloudKit: CoreData+CloudKit:…

Carl
- 683
- 5
- 18
16
votes
5 answers
NSPersistentStoreRemoteChangeNotification not getting fired
I am trying to perform history tracking in my CoreData+CloudKit project which uses NSPersistentCloudKitContainer. I have been following along with Apple's sample project
I want to perform certain task when the remote store has been updated. For this…

FE_Tech
- 1,534
- 13
- 25
16
votes
1 answer
How to set an ordered relationship with NSPersistentCloudKitContainer?
When I checked Used with CloudKit, the error Folder.children must not be ordered appeared. Any idea about an ordered relationship?
Using Xcode 11 (beta 3).
Here's the Folder Entity:

hstdt
- 5,652
- 2
- 34
- 34
16
votes
3 answers
Share Core Data between users with NSPersistentCloudKitContainer
Apple introduced the NSPersistentCloudKitContainer with iOS 13 which enable us to use CloudKit with Core Data. I got it working pretty much instantly on different devices but my main issue is still left.
Is it possible to share the data in an easy…

Jonas
- 1,112
- 5
- 17
- 28
13
votes
3 answers
CoreData with CloudKit on watchOS not syncing
I have managed to get CoreData with CloudKit working with the new NSPersistentCloudKitContainer on the iOS version of my app and got it to automatically sync while the app is running. However, when I went to set things up on the watchOS app, I…

shiningabdul
- 171
- 8
8
votes
1 answer
NSPersistentCloudkitContainer Memory Leak -> Crash? (iOS 15 beta 4, 5, 6 & 7...)
This is a copy of a thread I've created on Apple's Forum here
Background
I have an established app in the App Store which has been using NSPersistentCloudKitContainer since iOS 13 without any issues.
I've been running my app normally on an iOS…

Paul Martin
- 699
- 4
- 13
8
votes
1 answer
How to prune history right in a CoreData+CloudKit app?
My app uses CoreData with iCloud as backend. Multiple devices can access the iCloud database which is thus .public.
The local CoreData store is synchronized with iCloud using an NSPersistentCloudKitContainer.
I use history tracking according to…

Reinhard Männer
- 14,022
- 5
- 54
- 116
8
votes
1 answer
Synchronising old data with NSPersistentCloudKitContainer
I'm using NSPersistentCloudKitContainer to synchronise data between different devices with CloudKit. It works perfectly well with a new project, however when I'm using it with old projects the old data which was added with NSPersistentContainer does…

Wojtek
- 1,006
- 11
- 30
7
votes
0 answers
NSPersistentCloudKitContainer reverts NSManagedObject subclass to historic value
I have an app that uses NSPersistentCloudKitContainer to synchronise data with iCloud. Users reported occasional data loss after which I started debugging my implementation.
Part of my app’s implementation is showing a pop-up that displays…

Niels Mouthaan
- 1,010
- 8
- 19
7
votes
1 answer
Forcing NSPersistentContainer change Core Data
I just added the option for a user to toggle Cloud sync inside my app where I save whether or not the user wants to use iCloud sync in UserDefaults under "useCloudSync". I load my persistentContainer when the app runs with:
class CoreDataManager {
…

ap123
- 916
- 1
- 8
- 22
7
votes
2 answers
How to fetch CloudKit data manually to update the UI using NSPersistentCloudKitContainer and SwiftUI?
Let's say we have a working NSPersistentCloudKitContainer and just one CoreData entity named Item. Let's assume we want to sync between iOS, iPad and Mac app.
I watched this WWDC session about syncing CoreData and CloudKit and implemented basic sync…

Adelmaer
- 2,209
- 3
- 22
- 45
7
votes
2 answers
NSPersistentCloudKitContainer in Production
I've recently released an app that uses NSPersistentCloudKitContainer. In development my database is synchronizing across devices as expected, but in production my database is not synchronizing at all. Once I debugged the situation, I realized I had…

Jake
- 13,097
- 9
- 44
- 73
7
votes
2 answers
How to get default project with NSPersistentCloudKitContainer up and running?
I followed the same steps as in "Using Core Data With CloudKit":
New project
Enable Core Data + Cloud Kit
Add iCloud/CloudKit entitlement + Background mode/remote notifications entitlement.
In the iPhone Xr simulator I signed into an iCloud account…

Epaga
- 38,231
- 58
- 157
- 245