• 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 & Bindings: How to make a predicate search a to-many rel ationship
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CoreData & Bindings: How to make a predicate search a to-many rel ationship


  • Subject: Re: CoreData & Bindings: How to make a predicate search a to-many rel ationship
  • From: Charilaos Skiadas <email@hidden>
  • Date: Mon, 1 Aug 2005 14:49:00 -0500

On Aug 1, 2005, at 10:38 AM, Oliver Donald wrote:

Hi list,

I have an object model defined in CoreData that is similar to...

Book
  name
  author ---> Author
  chapers --->> Chapter

Just to make sure: you do have "chapters" there instead of "chapers" in your model, and this is just an email typo?
In my GUI I have an NSSearchField with predicates bound to my Books
array-controller. If I want a Search Predicate called 'Author Name' that
returns all Book objects with an Author object who's 'name' attribute
matches the search string, I can bind the key path to...


author.name contains[c] $value

...and that works. However, I want to have another predicate called 'Chapter
Name' that returns all Book objects with a Chapter object who's 'name'
attribute matches the search string. I tried...


chapters.name contains[c] $value


...and although no obvious errors are thrown up, no search queries return
any hits. I guess this is because it is a to-many relationship, unlike the
one before which is to-one. How would I go about searching through all the
objects in a to-many relationship like this?



try maybe "any chapters.name contains[c] $value".

Thanks,
Oli


Haris


_______________________________________________ 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 & Bindings: How to make a predicate search a to-many rel ationship (From: Oliver Donald <email@hidden>)

  • Prev by Date: Vu-meter
  • Next by Date: Sending messages to nil on Intel
  • Previous by thread: Re: CoreData & Bindings: How to make a predicate search a to-many rel ationship
  • Next by thread: Probably dumb question...
  • Index(es):
    • Date
    • Thread