I have an application using Core Data and bindings. I want to have an NSSearchField that can search through an NSArrayController bound to an NSTableView. The array controller contains Core Data objects that have a "name" field. I have setup the NSSearchField like this:
Bind To: the array controller
Controller Key: filterPredicate
Predicate Format: name contains[c] $value
这个运作良好。我想扩展它,使它能够搜索与数组控制器中对象相关的字段。 数组控制器中的每个对象都与另一种名为“标签”的对象具有一对多的关系,该对象具有名为“名称”的字段。 我尝试了以下操作:
Bind To: the array controller
Controller Key: filterPredicate
Model Key Path: tags
Predicate Format: name contains[c] $value
This however does not work. Nothing happens in the NSTableView when text is input into the NSSearchField. What is wrong with it?