1
votes

I need Core Data to reload the store after I overwrite it with a database that I generated and downloaded from a web server. I am having some trouble with getting the database reloaded. I have tried calling reset on all of the contexts and parent context along with setting the persistent store coordinator, managed object context, and managed object model to nil.

1
How are you overwriting the data? Are you deleting existing objects in the existing persistent store then writing your new objects? Or are you somehow overwriting the store file itself? - FluffulousChimp
Overwriting the store itself. I gzip decompress a file download and overwrite the sqlite store - Chris McKnight
Ah, I've never done this; but there a related question that might be helpful. - FluffulousChimp
I'm having trouble using this and the link you posted. I get an error when trying to remove the store saying it doesn't exist - Chris McKnight

1 Answers

0
votes

I figured out the problem. I was setting the app delegate's properties to nil but wasn't setting the managed object context of the root view controller to nil and reinitializing it.