ios - NSPredicate for a Core Data Search -


i have 3 nsmanagedobjets; person, stuff, , collection.

enter image description here

i want use nspredicate list of collections theperson has.

example: scott has objecta , objectb in collection letters , object1 in collection numbers.

i want able fetch request , collection letters , numbers.

i tried:

nspredicate *predicate = [nspredicate predicatewithformat:@"any stuffs.persons == %@", person]; 

and:

nspredicate *predicate = [nspredicate predicatewithformat:@"subquery(stuffs, $s, $s.persons == %@)", scott]; 

any suggestions?

your subquery syntax wrong (for full explanation, see this answer or this answer). should like:

subquery(stuffs, $s, $s.persons == %@).@count > 0 

Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -