Hey so I'm using a NSPredicate to filter an array. Currently I use the following piece of code:
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF.name contains[c] %@", searchText];
This has been working alright as it looks for the attribute .name and checks to see if it is contained in the searchText. I was wondering if there is a way for me to change it from checking if it's contained in the search text to if the search text begins with the search filter. I.E. if the search text is school
and I type sc
as the filter the search text stays but if I type sco
the search text school
is filtered out. Is there some sort of beginswith
that I can use instead of contains[c]
. Thanks!