Core Data bug? NONE, NOT ANY don't work in a predicate, SUBQUERY workaround does

Hi,

I have an NSPredicate with format:

"ANY containsEntity.id == %lld"

I was trying to not-it, but the following don't work:

NSCompoundPredicate(notPredicateWithSubpredicate: myPredicate)

"NOT(ANY containsEntity.id == %lld)"

"NONE containsEntity.id == %lld"

containsEntity is a one to many relationship

Is this a bug, as the following link may indicate? https://stackoverflow.com/questions/14471910/nspredicate-aggregate-operations-with-none

Using the SUBQUERY workaround detailed in that link, adapted to my own query, provided the desired predicate functionality.

SUBQUERY(containsEntity, $a, $a.id ==%lld).@count ==0"

If it's a bug, that's a surprisingly long lived one, please fix it. Otherwise, I'd be grateful if someone could explain what I'm missing.

Thank you in advance,

Javier

@javiermares I have the same issue as you with NSPredicate ignoring the NONE, but the logic worked with the SUBQUERY. In my case i can't use SUBQUERY as it is super slow. Did you find any other solutions to your problem but the SUBQUERY?

Core Data bug? NONE, NOT ANY don't work in a predicate, SUBQUERY workaround does
 
 
Q