Core Data, NSPredicate, ANY key.path == nil

后端 未结 2 1638
抹茶落季
抹茶落季 2020-12-16 20:48

I came up with a solution to this using subquery, but I don\'t understand why what I was trying to do first didn\'t work.

Here\'s my data model. I\'m fetching on Adv

2条回答
  •  醉酒成梦
    2020-12-16 20:50

    I believe you cannot use nil in the query. You should maybe use NULL or the format string construct like "ANY conditions.terrain == %@", nil.

    What puzzles me is that your subquery is working...

    The above is not correct, as NULLand NILcan be used interchangeably.

    Instead, the NSExpression Class Reference gives exactly your pattern (with @count) as the preferred example.

    Did you check that the terrain relationship is optional?

提交回复
热议问题