I have the following data model:
Person -(OneToMany)-> Task -(OptionalOneToOne)-> Completion
and I need a predicate to return me the persons without incomplete tasks and another for the opposite. A task is completed if there's a completion entity associated and not completed if that reference is nil.
I was tempted to use ALL task.completion = nil
and NONE task.completion = nil
but that's a mistake since the core data framework wraps everything in arrays or sets and they cannot contain a list of nils, so the only way to really solve that is using SUBQUERYs and that's way outside my comfort zone.
Plus, I can't find expressive examples of SUBQUERY inside NSPredicate but I know the answer lies there, if this is trivial for anyone please help me break this deadlock.
Thanks in advance