【发布时间】:2018-03-26 17:50:02
【问题描述】:
我想对 Core Data 上的 Transformable 属性执行过滤。 Transformer 值实际上是 NSAttributedString。我尝试设置如下谓词:
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(attributedString CONTAINS[cd] %@), _searchString];
它不起作用。它当然适用于 String 属性。
我已经用谷歌搜索了一整天,但没有运气。 谁能告诉我如何做到这一点?谢谢!
【问题讨论】:
-
我不熟悉
CoreData中的Transformer,但是您如何将NSAttributedString保存到CoreData中?你可能需要做“反向”来过滤它somethingAsAttributedString.string CONTAINS[c]...
标签: core-data nspredicate