Re: NSPredicate for a ANY match based on two properties at once
Re: NSPredicate for a ANY match based on two properties at once
- Subject: Re: NSPredicate for a ANY match based on two properties at once
- From: Jesse Grosjean <email@hidden>
- Date: Fri, 20 Jun 2008 16:57:50 -0400
You are correct, it doesn't work. And in trying to figure this out,
I've come to realize that I've used predicates "the hard way" in some
of my code. Try this instead:
NSPredicate *pred = [NSPredicate predicateWithFormat:@"(SUBQUERY(
tags, $x, $x.name = %@ AND $x.value = %@).@count != 0)",
@"aNameToMatch", @"aValueToMatch"];
Wow, that's it! Somehow I missed the whole SUBQUERY possibility. Thank
you very much!
Jesse
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden