Open deeje opened 5 years ago
How would you handle the replacement of Core Data?
do {
try container.persistentStoreCoordinator.replacePersistentStore(at: storeUrl, destinationOptions: nil, withPersistentStoreFrom: inputURL, sourceOptions: nil, ofType: NSSQLiteStoreType)
} catch {
print("Failed to replace persistent container...NC") }//End do-catch
}
I can successfully load the Core Data backup but get NSPersistentHistoryToken errors:
Fatal error: Unresolved error Error Domain=NSCocoaErrorDomain Code=134501 "(null)" UserInfo={Reason=Store - (
"4F49429F-3853-4978-9A43-AE28A1B644AE"
) not found in token - <NSPersistentHistoryToken - {
"4F49429F-3853-4978-9A43-AE28A1B644AE" = 1;
}>}, ["Reason": Store - (
"4F49429F-3853-4978-9A43-AE28A1B644AE"
)
I'm having a hard time Manually clearing Persistent History Tokens. Any advice?
currently, CloudCore assumes ownership of NSPersistentHistoryTracking, clearing out history after its been properly pushed to CloudKit. But NSPersistentHistoryTracking is also useful for shared containers and app extensions. Need to refactor such that apps can override default history clearing behavior.