Is there any way to do an accent insensitive string comparison? For example, é == e? I couldn\'t find any options to pass rangeOfString:options:. Any help is greatly appreci
You want to pass the NSDiacriticInsensitiveSearch
option to whichever method you use (e.g. compare:options:
or rangeOfString:options:
)
If you also want a substring search and have an array of items you want to filter I recommend this:
[self.objects filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id _Nullable evaluatedObject, NSDictionary<NSString *,id> * _Nullable bindings) {
MyClass *object = (MyClass *)evaluatedObject;
if ([object.name localizedStandardContainsString:filterString]) return YES;
return NO;
}]];