I made some changes to my model (but I don't need migration yet, so I just uninstall the application, built a clean one, etc.)
However, when I run it on the iPhone or in the simulator, I get the following error:
*** The application terminated due to the undetected exception "NSInvalidArgumentException", reason: "executeFetchRequest: error: the query for the selection must have an object."
I set the object as follows:
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Document" inManagedObjectContext:managedObjectContext];
My managed objectObjectContext is not null. But I suspect that it does not load the object model correctly or something like that, because if I display objects in the model, the list is empty:
managedObjectModel = [[NSManagedObjectModel mergedModelFromBundles:nil] retain];
NSLog(@"%d", [[managedObjectModel entities] count]);
How can I make sure the model is loaded?