building a predicate for empty optional to-many relationship
building a predicate for empty optional to-many relationship
- Subject: building a predicate for empty optional to-many relationship
- From: Ken Victor <email@hidden>
- Date: Tue, 5 Sep 2006 17:32:56 -0700
(the below is a simplified synopsis and typed into mail)
given a person entity that contains an optional to-many relationship,
creditCards, and given that one of the properties of a CreditCard
entity is its name, i can successfully set the filter predicate of an
NSArrayController to select people who have a credit card with a
specific name (eg):
NSPredicate* pred = [NSPredicate predicateWithFormat: @"ANY
creditCards.name == %@", cardName];
[arrayController setFilterPredicate: pred];
this works fine and will only display (in the controlled NSTableView)
those people who have the specified card name.
i would also like to be able to build a predicate to select all
people who don't have any credit cards, or all people who have any
credit cards. ie, i'd like to be able to build a predicate that will
select empty or non-empty relationships.
i've searched the archives unsuccessfully and read the documentation
and the predicates programming guide (several times) and still can't
figure this out.
can someone point me to some more documentation or provide a sample
of such predicates?
thanx,
ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden