获取请求必须有一个实体

获取请求必须有一个实体

本文介绍了executeFetchRequest:error: 获取请求必须有一个实体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个运行良好的项目.它检查了核心数据",并设置了所有数据模型.我今晚才开始添加几个实体和属性.当我现在尝试运行我的应用程序时,它甚至不会加载.它只是在我身上崩溃.

I had a project that was working fine. It had "Core Data" checked, and had the data model all set up. I only started adding a couple entities and properties tonight. When I try to run my app now, it won't even load. It just crashes on me.

这是错误:

'NSInvalidArgumentException', reason: 'executeFetchRequest:error: A fetch request must have an entity.'

我真的很害怕,因为我没有这个备份,如果我不能让它工作,我不知道我会做什么.:)

I'm really scared because I don't have a backup of this and if I can't get it working I don't know what I'll do. :)

提前致谢!

我厌倦了我的数据,所以我刚刚将一个新的空白 xcdatamodel 复制到我的项目中,我将重新开始.谢谢您的帮助!

推荐答案

好像我的数据损坏了,所以我删除了我的数据模型和 iPhone 模拟器中的数据库,重新开始.

It seemed as if my data got corrupted, so I deleted my data model and the database in the iPhone simulator, and started fresh.

这篇关于executeFetchRequest:error: 获取请求必须有一个实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 00:07