Search results for

NSPersistentCloudKitContainer

589 results found

Post

Replies

Boosts

Views

Activity

NSCloudKitMirroringDelegate "Never successfully initialised" error
After single attempt to fetch context on persistentContainer right after internet was restored (NWPathMonitor update handler), CoreData+CloudKit mirroring stuck and messaging that no internet, and cannot initialise. All CloudKit requests work perfect, but CloudKitMirroring cannot do sync, only app restart helps. Have no idea how simple fetch can kill CoreData mirroring... It happens each time I fetch on internet restore (I have to do that, to upload parent records to CloudKit manually as Apple did not implemented that in NSPersistentCloudKitContainer, all my records must have parents in order to share them). 2020-07-24 19:36:25.309059+0300 Grocery List[1045:148713] [error] error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate requestAbortedNotInitialized:]1379: <NSCloudKitMirroringDelegate: 0x281e048f0> - Never successfully initialized and cannot execute request '<NSCloudKitMirroringDelegateSerializationRequest: 0x283c6cec0> B20F9DB7-9600-4456-B682-056F4849FE4D resultType: Records resul
2
0
1.4k
Aug ’20
Core Data + CloudKit > how to incorporate existing app data into new NSPersistentCloudKitContainer
My experience implementing Core Data + CloudKit has frankly been relatively easy and I feel very positive about the new NSPersistentCloudKitContainer.Introduction and ThanksHonestly, I approached the new implementation of Core Data + CloudKit with some trepidation.My fears and anxiety were unfounded and I quickly learned just how (unsettlingly) easy it is to implement a CloudKit backed persistent store using NSPersistentCloudKitContainer.The new Core Data documentation is the best I've read by Apple for many years, so a huge and sincere thank you to the Core Data team.A couple of good posts on SO and a good blog by Andrew Bancroft helped close out my preliminary education... https://www.andrewcbancroft.com/blog/ios-development/data-persistence/getting-started-with-nspersistentcloudkitcontainer/The sample app provided by Apple (per WWDC session 202: Using Core Data with CloudKit) is madness for a beginner, however I really appreciate the effort that has gone into demonstrating SO MANY capabilities of
Topic: UI Frameworks SubTopic: UIKit Tags:
4
0
2.1k
Jul ’21
Reply to Setting up push notifications
Hello Steve, After adding the needed capabilities to your project, NSPersistentCloudKitContainer manages the notification configuration to keep your App (local storage) updated with the CloudKit storage. Here - https://developer.apple.com/documentation/coredata/mirroring_a_core_data_store_with_cloudkit/setting_up_core_data_with_cloudkit you can see the steps to enable the capabilities so your NSPersistentCloudKitContainer can keep your local data updated. Now, keep in mind that the freshness of the data from a Public database is different than from a Private database, NSPersistentCloudKitContainer polls for changes on Application Launch and every 30 minutes, see more detail in this year's WWDC session Sync a Core Data store with the CloudKit public database - min 10:30 - https://developer.apple.com/videos/play/wwdc2020/10650/?t=630. Good luck and feel free to reach out.
Topic: App & System Services SubTopic: General Tags:
Aug ’20
Reply to NSPersistentCloudKitContainer change cloudKitContainerOptions while app is running
I've similar concerns. The contexts from the first container will not be useable (at least in my testing). Short of tearing down the old core data stack, standing up the new one and traversing the view hierarchy to replace all existing managed objects and managed object contexts, there doesn't seem to be a way to toggle sync using NSPersistentCloudKitContainer. Not being able to pause or toggle sync seems to be a real shortcoming with NSPersistentCloudKitContainer. For kicks, I tried just disabling iCloud for the app Settings->AppleID->iCloud->App but that just deleted all the data on the device. I can live with the eventual consistency and not knowing sync progress, but not being able to toggle sync is a show stopper.
Aug ’20
Reply to WidgetKit and CoreData/CloudKit
Hi cristosv, Thanks for posting your solution to this online. I'm having the same problem, but it would be great it for you could help a little more. For example, all your code is working fine, but I can't seem to figure out how to use my core data entity in a Text() view in my widget. Below is my code, and any help with this or more sample code would be great. Thanks 🙏 import WidgetKit import SwiftUI import Intents import CoreData struct Provider: IntentTimelineProvider { func placeholder(in context: Context) -> SimpleEntry { SimpleEntry(date: Date(), configuration: ConfigurationIntent()) } func getSnapshot(for configuration: ConfigurationIntent, in context: Context, completion: @escaping (SimpleEntry) -> ()) { let entry = SimpleEntry(date: Date(), configuration: configuration) completion(entry) } func getTimeline(for configuration: ConfigurationIntent, in context: Context, completion: @escaping (Timeline) -> ()) { var entries: [SimpleEntry] = [] // Generate a timeline consisting of five entries an
Aug ’20
NSPersistentCloudKitContainer: Migration failed based on alphabetical order
I added a new Core Data model version, introducing a new entity. Based on the naming of the Entity I get different behaviour: A: If the entity is alphabetically ordered as last entity: Everything works fine. B: There entity is ordered before already existing entities: All records of these existing entities get a new CloudKit id. Resulting in duplicated data and broken relations. In some cases the seem-to-be new insert of these records causes the migration to fail. (Constraint unique violation, reason=constraint violation during attempted migration) My only workaround so far is to just give the entity a different name, to appear last in the list. __ Does anyone else experience this issues? I am not sure if my code could be able to trigger this kind of behaviour. I will try to reproduce it in an empty project, to file a bug report.
4
0
1k
Aug ’20
NSPersistentCloudKitContainer and CloudKit for Sharing
Hello,I've tried to figure this out for weeks now, but can't find a solution. I am not very experienced in App Development yet, so maybe it can be solved with little effort and I just don't know how...?I am working on a baby journal app where parents should be able to share a child record together with all its entries (existing ones and ones that are going to be added in the future) to be able to both edit and add and look at entries. So, I need sharing like in the Apple Notes App.I am using core data and the new NSPersistentCloudKitContainer. The core data model consists of a child record and entities that are referencing to the child.I know that at the moment NSPersistentCloudkitContainer doesn't support sharing.I have no clue how to add sharing with CKShare API beside the core data stuff. To have a proper solution, do I need toa) throw away NSPersistentCloudKitContainer and solely base the app on CloudKit API with no core data at all?b) add CloudKit Sharing via CKShare API, exist
4
0
3.5k
Aug ’20
Reply to NSSecureUnarchiveFromData is now necessary for transformable attributes but does not work with Core Data CloudKit?
I was able to remove the warnings by registering a new value transformer. I'm persisting a CLLocation, which conforms to NSSecureCoding. import Foundation import CoreLocation @objc(CLLocationValueTransformer) final class CLLocationValueTransformer: NSSecureUnarchiveFromDataTransformer { static let name = NSValueTransformerName(rawValue: String(describing: CLLocationValueTransformer.self)) override static var allowedTopLevelClasses: [AnyClass] { return [CLLocation.self] } public static func register() { let transformer = CLLocationValueTransformer() ValueTransformer.setValueTransformer(transformer, forName: name) } } Adding CLLocationValueTransformer as the transformer name works without warnings. The value is synced properly via NSPersistentCloudKitContainer, verified on multiple devices.
Aug ’20
[NSPersistentCloudKitContainer][Mac Catalyst specific crash] app is constantly crashing within a minute or two
Core Data, Catalyst, CloudKIt engineers need your assistance. I have an app that uses NSPersistentCloudKitContainer. It works great on iOS, but on the mac (Catalyst), the app is constantly crashing and is unusable. The CloudKit scheduler com.apple.xpc.activity.com.apple.cloudkit.scheduler.com.apple.coredata.cloudkit.activity.export seems to be at fault. It's crashing inside a generic dispatch block, so it's impossible to debug. Found a similar thread: https://developer.apple.com/forums/thread/128131?page=1 This is on Catalina 10.15.5 (19F101). MacBook Pro (Retina, 13-inch, Early 2015) Any ideas on how to debug/solve the root cause of this issue? Here's the image of the crash report (image hosted on imgbb.com): ibb.co nQy6rwm Thread 19 Queue : com.apple.xpc.activity.com.apple.cloudkit.scheduler.com.apple.coredata.cloudkit.activity.export (serial) #0 0x00007fff73de0436 in __xpcactivitydispatchblockinvoke.109.cold.3 () #1 0x00007fff73dde82b in _xpcactivitydispatchblockinvoke.109 () #2 0x000000010040f844
1
0
925
Aug ’20
NSPersistentCloudKitContainer with Mac Catalyst
Hello,I ported the WWDC 2019 NSPersistentCloudKitContainer demo project to Mac Catalyst and it keeps on crashing everytime I run (within a minute or so of the app running). I'm getting the same BAD EXC INSTRUCTION on my Mac Catalyst app as well (which uses NSPersistentCloudKitContainer). Both projects run just fine on iPad and iPhone.Anybody experiencing the same issue? Any help would be appreciated.
6
0
2k
Aug ’20