【发布时间】:2012-10-10 02:19:27
【问题描述】:
在我的项目中,我在一个实体中有一组属性。其中一个是作为字符串的路径。我想要在路径中以我的字符串作为子路径的所有记录。
示例: 路径:/var/mobile/Applications/C4ECC129-36D2-4428-8BB0-6B1F4C971FC1/Library/Caches/Packages/1000
Mystring:库/缓存/包/1000
我尝试使用 Like 并包含如下但失败了。
[NSPredicate predicateWithFormat:@"bookPath like[c] '%%%@'",Mystring];
[NSPredicate predicateWithFormat:@"bookPath Contains[cd] '%@'",Mystring];
有人可以帮助编写谓词来获取那些包含 mystring 的记录吗?
真的帮了我很多。
提前发送
【问题讨论】:
标签: ios sqlite core-data nspredicate nsfilemanager