Back to: All Forums  Core Data  Query question
06 Oct 2012, 13:36

The D (1 post)

I have this setup in my core data model

V <-->> O <<--> P

I am trying to write the right predicate so that I can get all V entities that have at least one or more O entities that match a certain P entity.

I've tried something like this:
NSPredicate * predicate = [NSPredicate predicateWithFormat:@"SUBQUERY(O, $b, ANY $bs.P == %@).@count > 0", P];

Not working. Obviously I am not thinking about this correctly so far. Any idea how I can get this query done properly?

Thank you
  You must be logged in to comment