Post

Replies

Boosts

Views

Activity

Reply to My swift object is being set to nil without telling me
Ok. There ended up being multiple instantiations of my NETransparentProxyProvider subclass. The first one, which was causing the problems, still had an XPC listener, and the anonymous XPC connection. In stopProxy, I added code to nil out the invalidation handler, invalidate them, and then set them to nil just for good measure. I must still be missing something, because I added a deinit method that logged it, and it's not being called. sigh. But! That is how it was being set to nil despite my observing it. I am much less frustrated now.
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’22
Reply to Switching Core Data between local and CloudKit
Ok, this seemed to do it for me.         persistentContainer = NSPersistentContainer(name: "DataModel")         let description = persistentContainer.persistentStoreDescriptions.first         description?.setOption(true as NSNumber, forKey: NSPersistentHistoryTrackingKey)         persistentContainer.loadPersistentStores { description, error in             if let error = error {                 fatalError("\(error)")             }         } I have a different class for CloudKit but I presume I could combine them more than I have. I finally found this answer.
Apr ’22