所以问题是,¿我该如何解决这个问题?我希望重音对于搜索是不可见的。希望我解释清楚
继承搜索栏方法:
NSMutableArray *allObject;
NSMutableArray *displayObject;
- (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString
{
if([searchString length] == 0)
{
[displayObject removeAllObjects];
[displayObject addObjectsFromArray:allObject];
}
else
{
[displayObject removeAllObjects];
for(NSDictionary *tmpDict in allObject)
{
NSString *val = [tmpDict objectForKey:doctorname];
NSRange r = [val rangeOfString:searchString options:NSCaseInsensitiveSearch];
NSString *val2 = [tmpDict objectForKey:doctoresp];
NSRange r2 = [val2 rangeOfString:searchString options:NSCaseInsensitiveSearch];
NSString *val3 = [tmpDict objectForKey:direccion];
NSRange r3 = [val3 rangeOfString:searchString options:NSCaseInsensitiveSearch];
if(r2.location != NSNotFound || r.location != NSNotFound || r3.location != NSNotFound)
{
[displayObject addObject:tmpDict];
}
}
}
return YES;
}
答案 0 :(得分:1)
添加NSDiacriticInsensitiveSearch
选项,以便e匹配é。