Hop This help you ... Just get your DB into MutableArray, then filter it by any words you want
//enter the words you want to filter by
NSArray *filterArray = @[@"water",@"salt"];
NSArray *dataBaseArray = @[@"1 piece of chicken breast", @"3 spoon of wheat", @"6 glass of water", @"1 can of corn", @"1 glass of lemon juice",@"1 piece of chicken breast", @"3 spoon of wheat", @"6 glass of water", @"1 can of corn", @"1 glass of lemon juice"];
// this is the array that get the records from the DB
NSMutableArray *tempArray = [[NSMutableArray alloc]init];
for (int i=0; i <dataBaseArray.count; i++) {
NSString *str = dataBaseArray[i];
BOOL found = NO;
for (NSString *word in filterArray) {
if ([str rangeOfString:word].location != NSNotFound)
{
found = YES;
}
}
if (!found) {
[tempArray addObject:str];
}
}
dataBaseArray = [[NSArray alloc]initWithArray:tempArray];