Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deleting CoreData store on OS X?

I'm playing around with CoreData in a Mac OS X application. After changing an entity i got the following error:

The managed object model version used to open the persistent store is incompatible with the one that was used to create the persistent store.

All answers i've found for this issue suggest implementing versioning/migration into the app, but I'm not interested in saving my data. Isn't there a less complicated solution for that? Like deleting the stock file or something like that? And if yes, where is this file located?

Thanks.

like image 609
shadowhorst Avatar asked May 10 '11 18:05

shadowhorst


1 Answers

If you don't want the data, then yes, you can simply delete the old file and create a new one. If your data is document based, then the document itself should be deleted. If you use a single store for the whole application (not document based), then you should look in the code that creates the store object to find the location. The template places the creation code in the application delegate, and the default location for the store is in ${HOME}/Library/Application Support/${APP_NAME}/.

like image 191
ughoavgfhw Avatar answered Oct 29 '22 21:10

ughoavgfhw