Re: NSPredicate for a ANY match based on two properties at once

2008-06-20 Thread Jesse Grosjean
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 = %@)[EMAIL PROTECTED] !=

Re: NSPredicate for a ANY match based on two properties at once

2008-06-20 Thread Jim Turner
On Fri, Jun 20, 2008 at 2:06 PM, Jesse Grosjean <[EMAIL PROTECTED]> wrote: >>> I want to construct searches such as: >>> >>> - find all entries that have a the tag named "priority" with the >>> value "1". > >> NSPredicate *tagPredicate = [NSPredicate predicateWithFormat:@"ANY >> tags.name = %@

Re: NSPredicate for a ANY match based on two properties at once

2008-06-20 Thread Jesse Grosjean
I want to construct searches such as: - find all entries that have a the tag named "priority" with the value "1". NSPredicate *tagPredicate = [NSPredicate predicateWithFormat:@"ANY tags.name = %@", tag.name]; NSPredicate *valuePredicate = [NSPredicate predicateWithFormat:@"ANY tags.va

Re: NSPredicate for a ANY match based on two properties at once

2008-06-20 Thread Jim Turner
On Fri, Jun 20, 2008 at 10:56 AM, Jesse Grosjean <[EMAIL PROTECTED]> wrote: > I'm having a hard time figuring out how to construct a query. The objects > involved are: > > Entry >- has many tags > > Tag >- name (string) >- value (string) > > I want to construct searches such

NSPredicate for a ANY match based on two properties at once

2008-06-20 Thread Jesse Grosjean
I'm having a hard time figuring out how to construct a query. The objects involved are: Entry - has many tags Tag - name (string) - value (string) I want to construct searches such as: - find all entries that have a the tag named "priority" with the value "1". I