Using predicates on an array controller to filter related objects

I have an application using master data and bindings. I want to have an NSSearchField that can search for the NSArrayController associated with the NSTableView. The array controller contains Core Data objects that have a name field. I installed NSSearchField as follows:

Bind To: the array controller
Controller Key: filterPredicate
Predicate Format: name contains[c] $value

It works. I want to expand it so that it can search for the fields of objects associated with the elements in the array controller. Each object in the array controller has a many relationship to another type of object called a tag, which has a name field. I tried the following:

Bind To: the array controller
Controller Key: filterPredicate
Model Key Path: tags
Predicate Format: name contains[c] $value

This, however, does not work. In NSTableView, nothing happens when text is entered in the NSSearchField. What is wrong with him?

+5
1

tags, pathController.filterPredicate.tags. filterPredicate , , , " " "", . , , filterPredicate NSArrayController , , :

Bind To: <array controller>
Controller Key: filterPredicate
Predicate Format: ANY self.tags contains[c] $value

self.tags tags, , , , .

+10

All Articles