Questions tagged [nspersistentcloudkitcontainer]

111 questions
6
votes
2 answers

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: success: 0 madeChanges: 0…
ryannn
  • 1,329
  • 1
  • 9
  • 21
6
votes
3 answers

CoreData + Cloudkit fetch() after app uninstall/reinstall returns no results

I am attempting to configure CoreData+CloudKit using NSPersistentCloudKitContainer to automatically sync data to/from CloudKit. Following the Apple guide, it was trivial enough to set up an Entity, add the appropriate capabilities in Xcode, set up…
6
votes
3 answers

How to handle first time launch experience when iCloud is required?

I am using CloudKit to store publicly available data and the new NSPersistentCloudKitContainer as part of my Core Data stack to store/sync private data. When a user opens my app, they are in 1 of 4 states: They are a new user with access to…
6
votes
1 answer

Core Data + CloudKit integration, large binary files sync crash

Core Data model attribute with type binary and "Allow External Storage" enabled cause crash in NSPersistentCloudKitContainer sync mechanism. This happens only on receiving device, meaning upload to CloudKit is successful, but download from CloudKit…
6
votes
1 answer

Relationship persistence with NSPersistentCloudKitContainer

I'm working on an app that uses NSPersistentCloudKitContainer to share data between devices. The core data model has multiple entities, two of which are connected using a relationship with it's respective inverse. The issue I'm having is that when I…
Jake
  • 13,097
  • 9
  • 44
  • 73
5
votes
1 answer

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 described in…
5
votes
0 answers

How to get notified when NSPersistentCloudKitContainer finish sync?

How to get notified when NSPersistentCloudKitContainer finish sync? I am interested in uploading Core Data changes completion, because can be notified by Core Data easily if changes was downloaded from server.
bodich
  • 1,708
  • 12
  • 31
5
votes
0 answers

Detect/Receive CloudKit CoreData Errors

In development I've switched to NSPersistentCloudKitContainer and have begun the terrifying process of trying to test as many scenarios as possible to make sure nobody loses any data. During some testing I saw an error like this:
lewis
  • 2,936
  • 2
  • 37
  • 72
5
votes
0 answers

NSPersistentCloudKitContainer error handling

Sometimes an NSPersistentCloudKitContainer will report an error in the console like so: *2020-04-14 16:41:27.725794+0100 ExampleApp[9736:8226377] [error] error: CoreData+CloudKit: -: : Sending…
Carl
  • 683
  • 5
  • 18
5
votes
4 answers

CoreData using NSBatchInsertRequest

I'm trying to insert Array of dictionary in CoreData using NSBatchInsertRequest according WWDC 2019 (https://developer.apple.com/videos/play/wwdc2019/230/). The insertResult is nil, and my CoreData is empty. let modelURL =…
benhi
  • 574
  • 1
  • 6
  • 24
4
votes
1 answer

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 across a user's devices. The setup is fairly…
barndog
  • 6,975
  • 8
  • 53
  • 105
4
votes
1 answer

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 new version of my current Core Data Model for the…
4
votes
0 answers

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 that I might have implemented CloudKit wrong this…
fphelp
  • 1,544
  • 1
  • 15
  • 34
4
votes
0 answers

When using NSPersistentCloudKitContainer: what to do if the user logs out of iCloud?

From several Apple WWDC talks on CloudKit, when using CloudKit to sync private user data across devices, when the user logs out of iCloud, the App is supposed to empty the on-device cache / local replica (I use Core Data for on-device permanence).…
4
votes
0 answers

Multiple duplicate NSPersistentStoreRemoteChange notifications fired from CloudKit + CoreData

I am seeing .NSPersistentStoreRemoteChange notifications being received multiple times, sometimes up to 10 times. I don't think this is harmful, but best case it's using up processing power. So my questions are: Is this harmful? Can I prevent…
lewis
  • 2,936
  • 2
  • 37
  • 72