• 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: CoreData: Using to-may relationships in fetch request predicates
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: CoreData: Using to-may relationships in fetch request predicates


  • Subject: re: CoreData: Using to-may relationships in fetch request predicates
  • From: Ben Trumbull <email@hidden>
  • Date: Sat, 29 Aug 2009 18:25:14 -0700

in  the typical CoreData example, if I want to fetch all departments
whose employees have a salary higher than a specified value, I will
perform a fetch on the Department entity using a predicate with the
following format:

"ANY employees.salary < %@"

This is working fine.
Now I want to fetch all departments whose employees fulfill the salary
condition AND are born after a certain date. I would expect something
like this to work:

"ANY (employees.salary < %@ AND employees.dateOfBirth > %@"

But it doesn't. Does anybody know if there is a way to use the ANY
statement with more than one condition?

You'll need to use a SUBQUERY predicate instead of an ANY/operator. Probably easiest to do SUBQUERY(..).@count > 0


Please file a bug.

- Ben

_______________________________________________

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


  • Prev by Date: re: Core Data observer exception in 10.6
  • Next by Date: Drawing a graph & testing ranges
  • Previous by thread: Re: CoreData: Using to-may relationships in fetch request predicates
  • Next by thread: MathML View or Component?
  • Index(es):
    • Date
    • Thread