Note that there are some explanatory texts on larger screens.

plurals
  1. POHaving trouble copying data to a mutable array
    primarykey
    data
    text
    <p>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");</p> <pre><code>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 &amp; Plumas"]) { predicate = [NSPredicate predicateWithFormat:@"(county Contains %@) OR (county Contains %@)",@"Butte",@"Plumas"]; } else if([region isEqualToString:@"Sutter, Yuba, &amp; Sierra"]) { predicate = [NSPredicate predicateWithFormat:@"(county Contains %@) OR (county Contains %@) OR (county Contains %@)",@"Sutter",@"Yuba",@"Sierra"]; } else if([region isEqualToString:@"Nevada &amp; Placer"]) { predicate = [NSPredicate predicateWithFormat:@"(county Contains %@) OR (county Contains %@)",@"Nevada",@"Placer"]; } else if([region isEqualToString:@"Sacramento &amp; El Dorado"]) { predicate = [NSPredicate predicateWithFormat:@"(county Contains %@) OR (county Contains %@)",@"Sacramento",@"El Dorado"]; } else if([region isEqualToString:@"San Joaquin, Amador, &amp; Calaveras"]) { predicate = [NSPredicate predicateWithFormat:@"(county Contains %@) OR (county Contains %@) OR (county Contains%@)",@"San Joaquin",@"Amador", @"Calaveras"]; } else if([region isEqualToString:@"Tuolumne &amp; Stanislaus"]) { predicate = [NSPredicate predicateWithFormat:@"(county Contains %@) OR (county Contains %@)",@"Tuolumne",@"Stanislaus"]; } else if([region isEqualToString:@"Merced, Mariposa, &amp; 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:&amp;error] mutableCopy]; </code></pre> <p>using debugger, I have narrowed down the error as occurring in:</p> <pre><code>mArray = [[managedObjectContext executeFetchRequest:request error:&amp;error] mutableCopy]; </code></pre> <p>How do I fix this?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload