I have two different NSArrayControllers but I'd like to use the text of one search field to filter them both. The predicate would be different for each controller. Is it possible? Right now I can only get it to filter one array controller at a time.

有帮助吗?

解决方案

YES this is possible.

You can do it as : This Stack Overflow answer by me shows how to do for one table and ArrayController.

For multiple you just need to add a new predicate, which will say as Predicate2. Please refer the screen shot:

Here Teacher and Student class contains a property name. However yo can have different property name. Also I am filtering only on one column or property you can search it for multiple columns/properties, for this refer the above link.

enter image description here

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top