【发布时间】:2012-10-20 22:32:08
【问题描述】:
我有以下NSManagedObjects:
Product <<->> ProductAttribute <->> ProductAttributeOption
使用 NSPredicate 获取基于产品的ProductAttributeOptions 的正确方法是什么?
我尝试了以下方法,但没有运气:
[NSPredicate predicateWithFormat:@"ANY SELF.productAttribute.products MATCHES %@", product]
[NSPredicate predicateWithFormat:@"ANY SELF.productAttribute@distinctUnionOfSets.products MATCHES %@"", product]
[NSPredicate predicateWithFormat:@"ANY SELF.productAttribute.@distinctUnionOfSets.giftProducts LIKE[cd] %@", self.giftProduct]
有什么建议吗?谢谢!
【问题讨论】:
标签: core-data nspredicate relationship nsmanagedobject nsfetchedresultscontroller