hello there and sorry for the stupid question but i think i might be missing something simple here and can t figure it out myself.
i m trying to search a table view using the following code:
- (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString
{
NSString *predicateFormat = @"(name contains[c] %@) OR (age contains[c] %@)";
NSPredicate *predicate = [NSPredicate predicateWithFormat:predicateFormat, searchString];
self.fetchedResultsController = [self resetFetchedResultsController:predicate cached:NO];
NSError *error = nil;
[self.fetchedResultsController performFetch:&error];
// Return YES to cause the search result table view to be reloaded.
return YES;
}
what i want to achieve is when the user searches the table to be able to search not only by "name" but with "age" as well!
my code above only searches the "name"
Am i missing something simple?
thank you for your time