Search code examples
ioscore-datacrash

executeFetchRequest:error: A fetch request must have an entity


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.

Here's the error:

'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. :)

Thanks in advance!

EDIT: I got fed up with my data, so I just copied a new blank xcdatamodel to my project and I'm going to start fresh. Thanks for the help!


Solution

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