Here's what I'm trying to do:
- I use NSFetchedResultsController to perform a fetch and track changes using its delegate
- I download some data and depending on some condition I sometimes delete all local data stored by CoreData by removing the NSPersistentStore and recreating a new one.
- I create managed objects based on the data and save them
- NSFetchedResultsController should now inform me that I have some changes
What I get instead is this crash when trying to save the data:
CoreData: error: Serious application error. Exception was caught during Core Data change processing. This is usually a bug within an observer of NSManagedObjectContextObjectsDidChangeNotification. Object's persistent store is not reachable from this NSManagedObjectContext's coordinator with userInfo (null)
I'm always using a single NSManagedObjectContext and I always read & save on the main thread.
It seems that switching the NSPersistenStore somehow messes up the fetched results controller. Is this expected behavior or am I doing something wrong?