Re: Re: NSSearchField and bindings question
Re: Re: NSSearchField and bindings question
- Subject: Re: Re: NSSearchField and bindings question
- From: email@hidden
- Date: Tue, 05 Jan 2010 02:07:35 +0000
On Jan 4, 2010 5:15pm, Saurabh Sharan <email@hidden> wrote:
You're not alone -- happened to me too. Though, when I downloaded the
code from pragprog.com, it worked.
- Saurabh
On Sun, Jan 3, 2010 at 10:11 PM, email@hidden> wrote:
I'm going the Zarra book, "Core Data" and I;ve reached the section where
an NSSearchfield is bound to one of the arrays used in the sample
application (page 43). As instructed in the book, I configured the
NSSearchfield's predicate binding as follows:
Controller Key: filterPredicate
Model Key Path: name
Display Name: predicate
Predicate Format: keyPath contains $value
This did not work and the NSTableView (column) which should update itself
from the NSArrayController does nothing.
I found an example of this sort of thing here:
http://homepage.mac.com/mmalc/CocoaExamples/controllers.html
and found that the binding in the second predicate used for the
NSSearchfield is configured like this:
Controller Key: filterPredicate
Model Key Path :
Display Name: Last Name
Predicate Format: lastName contains[cd] $value
I configured my predicate binding fashion and it works. So my question is:
Did I miss something in the book, or is the book wrong?
Thanks
_______________________________________________
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
Thanks for the reply. The downloadable code differs from the book as well:
Controller Key: filterPredicate
Model Key Path:
Display Name: Recipe Name <--- Here is one difference, book uses 'predicate'
Predicate Format: name contains[c] $value <--- Here is another, book
uses 'keyPath contains $value'
This works. So, if not anything else, I know of two ways to do this now.
Thanks again.
_______________________________________________
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