在做要用到Core Data 相关的项目,突然出现错误
"NSInternalInconsistencyException', reason: 'This NSPersistentStoreCoordinator has no persistent stores. It cannot perform a save operation.'"
我在程序中已经创建了持久化存储协调器,并使用SQLite数据库做持久化存储。
最好还是在stockover找到答案:
“If you are only getting this error in the Simulator then you have changed your data model and it hasn't deleted the sqlite file that you were previously using.
So go to: ~/Library/Application Support/iPhone Simulator/User/Applications/
Then look through the HEX-named folders until you see your app. Open the Documents
directory and delete the sqlite file. The error should go away.”
可能是你改变coredata的属性项之后再运行的话在模拟器中会出现这个问题。找上面说的,找到mac下的模拟器中的程序路径,然后删掉其sqlite文件再运行就好了!!!