• 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: predicate for empty relationship?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CoreData: predicate for empty relationship?


  • Subject: Re: CoreData: predicate for empty relationship?
  • From: John Timmer <email@hidden>
  • Date: Thu, 17 Nov 2005 10:33:52 -0500
  • Thread-topic: CoreData: predicate for empty relationship?

> Say I have a Person entity, with a to-many relationship to pets.
>
> How do I write a predicate which will select all the people who
> currently don't have any pets?
>
> Thanks,
> Jim


Jim -

Don't know if this got answered (I've been way too busy of late to follow
the list that carefully), but wouldn't the following work:

    NSPredicate *thePredicate = [NSPredicate predicateWithFormat:
@"pets.@count == 0"];

Then just look for persons where that's true.


JT

_______________________________________________
This mind intentionally left blank


 _______________________________________________
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

References: 
 >CoreData: predicate for empty relationship? (From: Jim Correia <email@hidden>)

  • Prev by Date: Re: "ld: warning multiple definitions of symbol ..."
  • Next by Date: Re: NSDrawer buttons still active when parent window has a sheet open
  • Previous by thread: CoreData: predicate for empty relationship?
  • Next by thread: RE: How to get Tool Tip color ? -- Solved
  • Index(es):
    • Date
    • Thread