CoreData & Bindings: How to make a predicate search a to-many rel ationship
CoreData & Bindings: How to make a predicate search a to-many rel ationship
- Subject: CoreData & Bindings: How to make a predicate search a to-many rel ationship
- From: Oliver Donald <email@hidden>
- Date: Mon, 1 Aug 2005 16:38:26 +0100
Hi list,
I have an object model defined in CoreData that is similar to...
Book
name
author ---> Author
chapers --->> Chapter
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?
Thanks,
Oli
DISCLAIMER: The information contained in this e-mail is confidential and may
be privileged. It is intended for the addressee only. If you are not the
intended recipient, please delete this e-mail immediately. The contents of
this email must not be disclosed or copied without the sender's consent. We
cannot accept any responsibility for viruses, so please scan all
attachments. The statements and opinions expressed in this message are those
of the author and do not necessarily reflect those of the company. The
company does not take any responsibility for the views of the author.
_______________________________________________
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