Core data to-many NSPredicate with AND

谁说我不能喝 提交于 2019-12-03 08:54:30

What you want is a subquery. In predicate format syntax:

SUBQUERY(self.localized, $x, $x.name LIKE %@ AND $x.localeIdentifier == %@).@count > 0

where the SUBQUERY expression returns a collection of instances in the self.localized collection that match the predicate in the third argument. Kind instances for which this SUBQUERY expression is non-empty (ie @count > 0) match your desired criteria.

The SUBQUERY expression was introduced in OS X 10.5.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!