I have a tableview with a search bar. I want to search my whole core data database.

I loaded everything into an array here:

```
NSEntityDescription *entityDescription = [NSEntityDescription entityForName:@"Entity" inManagedObjectContext:managedObjectContext]; 
NSFetchRequest *request = [[[NSFetchRequest alloc] init] autorelease]; 
[request setEntity:entityDescription]; 
NSError *error = nil; 
NSArray *array = [managedObjectContext executeFetchRequest:request error:&error];   
self.myArray = array;

```

I'm then searching using this method but getting an error:

```
- (void) searchTableView {

    NSString *searchText = searchBar.text;
    NSMutableArray *searchArray = [[NSMutableArray alloc] init];

    for (NSDictionary *dictionary in myArray)
    {
        NSString *value = [dictionary objectForKey:@"name"];
        [searchArray addObject:value];
    }

    for (NSString *sTemp in searchArray)
    {
        NSRange titleResultsRange = [sTemp rangeOfString:searchText options:NSCaseInsensitiveSearch];

        if (titleResultsRange.length > 0)
            [copyListOfItems addObject:sTemp];
    }
    [searchArray release];
    searchArray = nil;
}

```

But when I search, I get the crash here:

```
MedicalCode *code = [self.copyListOfItems objectAtIndex:indexPath.row]; 
cell.codeLabel.text = code.description;

```

Error:

```
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ICD9Disease objectForKey:]: unrecognized selector sent to instance 0x1be6e0'

```