CloudKit compound query (query with OR)

喜夏-厌秋 提交于 2019-12-01 17:41:42

CKQuery supports AND and NOT, so you would imagine you could use simple boolean algebra to create a query based on the fact that NOT(NOT A AND NOT B) == A OR B. HOWEVER, the documentation specifically says:

"The NOT compound operator is not supported in the following cases:

You cannot use it to negate an AND compound predicate."

So you must query for each of the ORed predicates separately save them each as a SET and then take the intersection of the two sets to get the final result

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