• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSPredicate for a ANY match based on two properties at once
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSPredicate for a ANY match based on two properties at once (From: Jesse Grosjean <email@hidden>)
 >Re: NSPredicate for a ANY match based on two properties at once (From: "Jim Turner" <email@hidden>)
 >Re: NSPredicate for a ANY match based on two properties at once (From: Jesse Grosjean <email@hidden>)
 >Re: NSPredicate for a ANY match based on two properties at once (From: "Jim Turner" <email@hidden>)

  • Prev by Date: Re: SSCrypto Framework
  • Next by Date: Re: SSCrypto Framework
  • Previous by thread: Re: NSPredicate for a ANY match based on two properties at once
  • Next by thread: Quartz Composer file in IB
  • Index(es):
    • Date
    • Thread