Core Data. How to swap NSPersistentStores and inform NSFetchedResultsController?
问题 I'm implementing backup and restore (via Dropbox) of a user's Core Data persisted data. For a restore I pull the files down from Dropbox and store them temporarily in the Documents directory. Then I create a new NSPersistentContainer and use it to replace the current persistent store (in the ApplicationSupport directory) before deleting the no longer needed files in the Documents directory. I'm using the MasterDetail template for now and so I have the usual time-stamped entities and the