【发布时间】:2011-05-31 22:18:02
【问题描述】:
我正在尝试搜索多个字段。像这样的:
[NSPredicate predicateWithFormat:@"(name title contains[cd] %@) AND (title contains[cd] %@", self.searchBar.text];
在名称字段或标题字段上进行搜索。
另外,如果有人知道通配符搜索会是什么样子,我也将不胜感激。
我试过了:
[NSPredicate predicateWithFormat:@"* contains[cd] %@", self.searchBar.text];
我的错误代码:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unable to parse the format string "(name contains[cd] %@) OR (title contains[cd] %@"'
【问题讨论】:
标签: iphone ios core-data nspredicate