我已在我的应用上实现了搜索功能。但是有些问题即将来临。请给出一些建议。
假设在我的Db中保存记录名称 - 高级iphone开发者。
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"( name contains[cd] %@) ", @"senior "]; // **it work**
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"( name contains[cd] %@) ", @"senior iphone developer"]; // **it work**
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"( name contains[cd] %@) ", @"senior developer"]; // **it doesnt work**
有什么想法吗?
答案 0 :(得分:0)
我认为你在寻找:
[NSPredicate predicateWithFormat:@"name like[cd] %@", @"senior*developer"];