I have the following situation:
NSArray(
NSArray(
string1,
string2,
string3,
string4
)
,
NSArray(
string1,
string2,
string3,
string4
)
)
what I need is a predicate which returns the array that contains a specific string from the objectAtIndex:0 which is related to string1. I should get back the entire array because I need to process the other strings inside that array. Is it possible?
what i am tried to do for now is the following:
NSPredicate *resultPredicate = [NSPredicate predicateWithFormat:@"ANY SELF contains[cd] %@",searchText];
searchData = [myArray filteredArrayUsingPredicate:resultPredicate];
NSLog(@"array %@",searchData);`
my problem is my code will return the array when any of string1,string2,string3,string4 contains the searchText and not only string1 and i can't find anyway to achieve my goal!