I keep getting the error "Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[MainViewController minimalFormInContext:]: unrecognized selector sent to class" from this line of code: NSLog(@"Accessing specific mine entities");
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Mine" inManagedObjectContext:managedObjectContext];
NSFetchRequest *request = [[[NSFetchRequest alloc] init] autorelease];
NSError *error = nil;
[request setEntity:entity];
NSPredicate *predicate;
NSPredicate *metalFilter;
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *region = [defaults stringForKey:@"mineArray"];
if([region isEqualToString:@"Butte & Plumas"])
{
predicate = [NSPredicate predicateWithFormat:@"(county Contains %@) OR (county Contains %@)",@"Butte",@"Plumas"];
}
else if([region isEqualToString:@"Sutter, Yuba, & Sierra"])
{
predicate = [NSPredicate predicateWithFormat:@"(county Contains %@) OR (county Contains %@) OR (county Contains %@)",@"Sutter",@"Yuba",@"Sierra"];
}
else if([region isEqualToString:@"Nevada & Placer"])
{
predicate = [NSPredicate predicateWithFormat:@"(county Contains %@) OR (county Contains %@)",@"Nevada",@"Placer"];
}
else if([region isEqualToString:@"Sacramento & El Dorado"])
{
predicate = [NSPredicate predicateWithFormat:@"(county Contains %@) OR (county Contains %@)",@"Sacramento",@"El Dorado"];
}
else if([region isEqualToString:@"San Joaquin, Amador, & Calaveras"])
{
predicate = [NSPredicate predicateWithFormat:@"(county Contains %@) OR (county Contains %@) OR (county Contains%@)",@"San Joaquin",@"Amador", @"Calaveras"];
}
else if([region isEqualToString:@"Tuolumne & Stanislaus"])
{
predicate = [NSPredicate predicateWithFormat:@"(county Contains %@) OR (county Contains %@)",@"Tuolumne",@"Stanislaus"];
}
else if([region isEqualToString:@"Merced, Mariposa, & Madera"])
{
predicate = [NSPredicate predicateWithFormat:@"(county Contains %@) OR (county Contains %@) OR (county Contains %@)",@"Merced",@"Mariposa",@"Madera"];
}
[request setPredicate:predicate];
mArray = [[NSMutableArray alloc] init];
mArray = [[managedObjectContext executeFetchRequest:request error:&error] mutableCopy];
using debugger, I have narrowed down the error as occurring in:
mArray = [[managedObjectContext executeFetchRequest:request error:&error] mutableCopy];
How do I fix this?