This code causes a crash with error Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'executeFetchRequest:error: A fetch request must have an entity.
self.devices = [[managedObjectContext executeFetchRequest:fetchRequest error:nil] mutableCopy];
NSLog(@"point one");
NSString *yourTrip=@"trip1";
NSFetchRequest *request = [[NSFetchRequest alloc] init];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"thetrip== %@", yourTrip];
[request setEntity:[NSEntityDescription entityForName:@"thetrip" inManagedObjectContext:managedObjectContext]];
[request setPredicate:predicate];
NSError *error = nil;
NSArray *array = [managedObjectContext executeFetchRequest:request error:&error];
if (array == nil)
{
NSLog(@"problemo");
}
The crash specifically happens after the NSError *error =nil;
thetrip
? Log the entity description. – Wain