![]() It shouldn’t normally be necessary to delete history. It will recover but it’s not a good customer experience. If you delete history the cloud sync is reset and has to upload everything from scratch. NSPersistentCloudKitContainer uses the persistent history token to track what to sync. Persistent History Trackingĭo I ever need to purge the persistent history tracking data? When should I expect the isDeleted flag to be true?Ĭore Data sets the isDeleted flag after you delete the object but before you save the context. ![]() It’s also recommended to use query generation when working with fetched results controllers so that items in a list don’t change unexpectedly while the user is scrolling. One suggestion was to use query generation to pin the context. ![]() It’s not clear to me if this expected behaviour or not. I didn’t get a definitive answer to this question, the Apple Engineer was going to ask somebody else but we ran out of time to come back to it. Deleting the object in the list view faults the object in the detail view setting all non-scalar properties to nil. CORE DATA LAB WINDOWSMy scenario is two windows on an iPad, one showing a SwiftUI list, the other showing a detail view of an observed object. Is testing isFault the best way to protect against objects that I’ve deleted in another window/process? When observing changes to an NSManagedObject I need to guard against Core Data faulting the object. You need some logic to avoid making requests until Core Data has finished loading the store. Is that still recommended?Īsync is the right approach for a large database but recommended even for small databases. ![]() I prefer to load asynchronously to avoid blocking the UI during migrations or loading large databases. CORE DATA LAB CODELoading store asynchronouslyĪpple sample code and docs always seem to load the store synchronously. I’ve summarised based on my notes and memory so it’s always possible I misunderstood something. Note that this is not a verbatim transcript of the conversation. I started with some general Core Data questions, before moving on to CloudKit sync. My questions were not app-specific so I thought I would share my notes with you. I wanted to check my understanding of CloudKit sync with a private store. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |