Hi,
I have a NSOutlineView populated by a NSTreeController and I'd like to filter it with a NSSearchField :
According to this post, it is not possible directly because NSTreeController doesn't have a filter predicate but according to that answer, we could filter the nodes of the array which is the content of the NSTreeController.
I tried this method but I don't have the good result :
Some nodes which does not contain the string still stay in the NSOutlineView.
Like I said in this post, I'm not familiar with the predicates so maybe my error comes from that. Here it is :
let thePredicate = NSPredicate(format: "%K CONTAINS[cd] %@", "name", theStr)
Also, the difficulty here is I need to keep the parent node even if it doesn't have the predicate condition if one of its child has it.
Other second solution is to put the result in a NSTableView but I need to build the same cell than in the NSOutlineView, etc...
Any idea ?
Thx.