我很熟悉如何喂养数据从一个核心数据的实体进入一个 NSPopUpButton 项,以便它可以选择的另一种。绑定,像这样:

值:

-> ValueSelection.Content
    Bind To: Value Source Entity
    Controller Key: arrangedObjects
    Model Key: N/A

值显示的 NSPopUpButton:

-> ValueSelection.ContentValues
    Bind to: Same entity as ValueSelection.Content
    Controller Key: arrangedObjects
    Model Key: the name of the attribute you wish to have displayed

联系到目的地的价值:

-> ValueSelection.SelectedObject
    Bind to: Destination entity
    Controller Key: selection
    Model Key: Name of the attribute/relationship in the destination entity.

我想要做的就是弄清楚,如果有一种方法来设立了一个过滤器(我猜中 ContentValues)那里你只能有它抓住条目从该实体具有一定的属性标志的检查(例如说我拉着我 users 实体和我只是想表的男性或女性用户)。

有帮助吗?

解决方案

NSArrayController有一个"滤波器谓",可设置在接口的建设者或者在代码(通过的方法在文档这是我的链接).看看 谓编程指南 图找出是什么谓你会需要提供你所需的过滤器。

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