【发布时间】:2011-12-19 09:15:22
【问题描述】:
我想搜索属性description(NSString 实例)中是否有给定的单词。
我试过这个谓词:
[NSPredicate predicateWithFormat:@"description CONTAINS[cd] %@", theWord];
它可以工作,但它也能找到 子词。
例如,给定theWord:
汽车
它也会这样description:
圣诞颂歌
相反,我希望我的谓词仅匹配 a、christmas 或 carol。
(我正在使用 Core Data 和 NSFetchRequest。)
【问题讨论】:
标签: cocoa-touch core-data nsstring nspredicate nsfetchrequest