113 questions
0
votes
0
answers
46
views
NSPersistentCloudKitContainer.share() deadlocks - only works in CKShareTransferRepresentation.prepareShare
I am building an iOS 26 SwiftUI app with Swift 6 strict concurrency using NSPersistentCloudKitContainer with a private and shared store for CloudKit zone-based sharing.
The goal
I want to share a Core ...
0
votes
0
answers
80
views
Remove entity from NSPersistentCloudKitContainer
I'm using NSPersistentCloudKitContainer and I have added an entity (to the private database) to the core data model. Now I have realised that I don't need that entity anymore and I want to get rid of ...
0
votes
0
answers
39
views
Is it possible to revert committed deletion from Core Data Cloudkit in Swift?
A user has accidentally deleted a root record that removes all data from the user. The data is stored in Cloudkit CoreData with Transaction History enabled.
I have noticed in the CoreData database ...
0
votes
1
answer
274
views
CloudKit & NSPersistentCloudKitContainer - Fetch the CKRecord of creatorUserRecordID for every CKRecord in public database
I wasn't sure how to phrase the question. I know it's misleading.
Context:
I'm using NSPersistentCloudKitContainer for my public and private database. The CoreData model has two configurations: Local, ...
3
votes
0
answers
159
views
Understanding Syncing between Core Data and CloudKit Public Database using NSPersistantCloudKitContainer
Can someone please give me an overview of how sync works between Core Data and the public CloudKit database when using the NSPersistentCloudKitContainer and please point out my misunderstandings based ...
2
votes
0
answers
196
views
CloudKit notification is fireing many times on one import
I've set up a Notification listener which should fire when the CloudKit (NSPersistentCloudKitContainer) import is finished (so once), but the notification gets fired twice, sometimes thrice on one ...
0
votes
2
answers
322
views
Apple rejects my app due to crash in CoreData integration file but can't reproduce
I developed an app using CoreData and CloudKit. It gives some warning message in the console but works with no problem. However Apple rejected due to crash which I could not replicate. Really ...
1
vote
0
answers
128
views
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(
...
4
votes
1
answer
2k
views
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 ...
2
votes
1
answer
589
views
CoreData + CloudKit share broken after stop sharing
I'm having a hard time managing a shared core data object. I'm hoping that I'm doing something wrong and it's not just a bug in the cloudkit sharing but I also tried it with a sample app from apple ...
4
votes
1
answer
1k
views
CoreData & CloudKit toggle iCloud sync (enable/disable)
Since my last question (here toggle between local and iCloud CoreData store) I was able to make a lot of progress.
I am switching between NSPersistentCloudKitContainer and NSPersistenttContainer
But......
3
votes
0
answers
196
views
CloudKit integration requires that the value transformers for transformable attributes are available via +[NSValueTransformer valueTransformerForName:
I'm using CoreData+CloudKit to store data, currently there are two Entities,AEntity and BEntity:
In AEntity, there is an attribute: content, used to store NSAttributedString, its Type is "...
2
votes
1
answer
827
views
iOS - CoreData CloudKit sharing - participants adding children
I have implemented sharing of items from my Core Data store, using the NSPersistentCloudKitContainer api, with limited success. The objects I share (a TripsLog) have child objects (Trip), which appear ...
0
votes
1
answer
644
views
NSPersistentCloudKitContainer & persisting Core Data after removing a share
I'm using NSPersistentCloudKitContainer to sync CoreData+Cloudkit. I am basing my code on Apple's example in the code downloaded (see reference below). My Core Data root record is a hierarchy (list ...
1
vote
1
answer
457
views
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 ...
1
vote
2
answers
880
views
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 ...
1
vote
1
answer
625
views
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 ...
2
votes
0
answers
115
views
Detecting that a user's CloudKit storage quota has been reached - NSPersistentCloudKitContainer
When a user's CloudKit allocations is full, sync between their devices stops working. This is fairly common considering the 5GB default. Unfortunately detecting it on the app side isn't as ...
2
votes
0
answers
648
views
Very slow sync of CoreData + CloudKit on WatchOS
Setup:
I have a watch app that is not independent, but cooperates with the companion iOS app.
Both use CoreData + CloudKit, and the size of the data stored in iCloud is very little (a few hundred ...
1
vote
0
answers
331
views
How do I retrieve CloudKit Reference List?
I have setup my CloudKit record types the same as my local structs and models in my code but can't seem to find a way to retrieve the list of references.
For example, I have a UserData record type ...
0
votes
1
answer
188
views
I use NSPersistentCloudKitContainer to sync with iCloud, in debug works but installing from TestFlight no
I use NSPersistentCloudKitContainer to sync with user iCloud the data, it works perfectly installing through Xcode on device but when install from TestFlight it doesn't work at all seems there is ...
3
votes
0
answers
322
views
how to use NSPersistentCloudKitContainer.eventChangedNotification
Hi I am trying to get event notification from NSPersistentCloudKitContainer to get notification if data change or not?
NSPersistentCloudKitContainer.eventChangedNotification
but I didn't find any ...
4
votes
1
answer
406
views
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 ...
5
votes
1
answer
1k
views
CoreData + CloudKit reverting a CKShare to CoreData store
I use NSPersistentCloudKitContainer to save objects in CoreData + CloudKit. I have integrated a sharing function that moves an object to a separate zone to share using UICloudSharingController, as ...
9
votes
1
answer
2k
views
NSPersistentCloudKitContainer and persistent history tracking
I'm building an application that makes use of NSPersistentCloudKitContainer. The app doesn't have sharing functionality and its only backend functionality is to use the cloudkit container to sync data ...
0
votes
1
answer
242
views
Is it necessary to use merge policy with CoreData and Allows external storage to avoid crash?
I use CoreData + NSPersistentCloudKitContainer to backup my model. One of my NSManagedObject has a picture stored as Binary Data and Allows external storage checked.
It's very random but sometimes ...
1
vote
2
answers
646
views
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 ...
3
votes
1
answer
912
views
Core Data database wiped when using NSPersistentCloudKitContainer
I currently have an application that uses Core Data with Apple's NSPersistentCloudKitContainer and I've a 2 users mentioning they lost their data when updating the app - I'm using Lightweight ...
2
votes
0
answers
322
views
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 ...
2
votes
0
answers
354
views
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: <CKError 0x280df8e40: "Quota Exceeded" (...
2
votes
2
answers
2k
views
Migrating existing app from NSPersistentContainer to NSPersistentCloudKitContainer
I have an app that uses local device only CoreData (NSPersistentContainer). I am looking to migrate so the app is compatible with NSPersistentCloudKitContainer. I understand all the CloudKit setup ...
1
vote
1
answer
478
views
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 ...
3
votes
1
answer
881
views
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 ...
9
votes
1
answer
1k
views
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.
...
1
vote
1
answer
456
views
Handling CKErrors while using NSPersistentCloudKitContainer
I have an app that uses Core Data, works great. I decided to try to use iCloud to sync data across multiple devices. I followed the basic steps of changing NSPersistentContainer to ...
1
vote
0
answers
525
views
watchOS/CloudKit and background sync
I'm working on an Swift App which runs on iOS, macOS and watchOS (Xcode) using CloudKit (see code for the initialization of the CloudKit-Persistency-Container below). The app works great: the data ...
7
votes
1
answer
1k
views
Releasing new Core Data Schema to iCloud production
I have an app out in the App Store, and I am working on a lightweight migration (adding new attributes and new entities, not deleting anything). From extensive research, I know that I need to add a ...
6
votes
2
answers
592
views
iOS15 B4 NSPersistentCloudKitContainer "Account Temporarily Unavailable" Error
I'm using NSPersistentCloudKitContainer on iOS15 beta 4 to sync core data across devices. When launching on device, logged into iCloud, I receive the following error in the logs:
<...
0
votes
1
answer
247
views
CloudKit bytes to array of strings
I have a record on my CloudKit public database that was made via the NSPersistentCloudKitContainer. In Core Data, the attribute is of type [String] and when I add it to the public database, it is ...
3
votes
1
answer
662
views
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 ...
0
votes
0
answers
32
views
Query regarding syncing data across iPhones or iDevices for a user
I have a photo album app that uses core-data. As of now it does not utilise login nor do I plan to.
My requirement is that the album should sync across a user's multiple iDevices.
I was watching https:...
3
votes
1
answer
1k
views
Lightweight CoreData Migration with CloudKit
Does Core Data handle simple data-model additions like a new attribute w/out any further "help" from me? In my case, I have an app that uses Core Data for varius things related to a users ...
4
votes
0
answers
420
views
Using CloudKit Containers Properly
I have an app that uses NSPersistentCloudKitContainer for iCloud Sync to users who want it and has worked for all platforms (iPhone/iPad/Mac). But now, trying to add Apple Watch support, I realize ...
0
votes
1
answer
329
views
How to read arrays with NSPersistentCloudKitContainer (CloudKit with Core Data)?
I have [String] and [Int] attributes in my entity on Core Data/type on CloudKit, where they are String list and Int64 list respectively. I'm trying to synchronize them via ...
1
vote
1
answer
599
views
iCloud Sync does work on iPhone & Mac but not on iPad
I have found a strange problem with iCloud Sync.
Situation: I have developed an iOS, iPadOS & macOS App using SwiftUI. All three Versions share the same Codebase (macOS Version is a Catalyst iPad ...
2
votes
0
answers
204
views
Released Mac Catalyst app uses wrong Core Data database
I released an iOS + Mac Catalyst app that uses Core Data and NSPersistentCloudKitContainer.
No issues for the users, but something is wrong for me when installing the app from the Mac App Store: it ...
0
votes
1
answer
825
views
Problem getting NSPersistentCloudKitContainer to sync between devices (SwiftUI, iOS)
I have set up my Core Data model with NSPersistentCloudKitContainer:
struct PersistenceController {
static let shared = PersistenceController()
let container: NSPersistentCloudKitContainer
...
0
votes
1
answer
212
views
NSPersistentCloudKitContainer returns no data on first app launch
I'm trying to mirror Core Data to iCloud using CloudKit. When I delete the app on simulator and then run the app, the app does not show any data. I then run it again and this time it shows data. I ...
1
vote
0
answers
463
views
No stores in the coordinator are configured to use CloudKit
Upon attempting to run
container = NSPersistentCloudKitContainer(name: "Test")
container.initializeCloudKitSchema()
I'm getting the following error:
NSLocalizedFailureReason=Couldn't ...
2
votes
1
answer
585
views
Fast local update of CoreData+CloudKit with public database changes
My app uses CoreData+Cloudkit with a public database.
By default, iCloud sync with a public database is only done at launch and then every half hour.
Since my app requires faster sync, all users are ...