删除OS X上的CoreData存储? [英] Deleting CoreData store on OS X?

查看:77
本文介绍了删除OS X上的CoreData存储?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Mac OS X应用程序中使用CoreData.更改实体后,出现以下错误:

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?

谢谢.

推荐答案

如果您不想要数据,则可以,只需删除旧文件并创建一个新文件即可.如果您的数据是基于文档的,则应删除文档本身.如果您对整个应用程序使用单个商店(而不是基于文档的商店),则应查看创建商店对象的代码以查找位置.该模板将创建代码放置在应用程序委托中,并且商店的默认位置在${HOME}/Library/Application Support/${APP_NAME}/中.

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}/.

这篇关于删除OS X上的CoreData存储?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆