Answer the question
In order to leave comments, you need to log in
How to do dynamic string search in IOS?
There is an array with strings, you need to do a dynamic search for strings. How to implement?
Answer the question
In order to leave comments, you need to log in
For example like this:
+ (NSArray *)findText:(NSString *)searchText inArrayOfStrings:(NSArray *)arrayOfStrings
{
NSPredicate *searchPredicate = [NSPredicate predicateWithFormat: @ "(SELF contains[cd] %@)", searchText];
return [arrayOfStrings filteredArrayUsingPredicate:searchPredicate];
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question