NSPopUpButtonリストに表示されるコアデータのエンティティからのフィルタリングエントリ

StackOverflow https://stackoverflow.com/questions/1845886

質問

私はそれが別のために選択することができるようにNSPopUpButton項目に1つのコアデータのエンティティからデータをフィードする方法に精通してい。そのようなバインディングます:

の値のために自分ます:

-> 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はは "<のhref =" http://developer.apple.com/mac/library/documentation/Cocoa/Reference/ApplicationKit/Classes/NSArrayController_Class/Reference/Reference.html#//apple_ref/occ/を持っていますinstm / NSArrayControllerは/ setFilterPredicate:「REL = 『nofollowをnoreferrer』>フィルタ述語の」、インタフェースビルダーまたはコードで設定することができる(ドキュメント方法を介してIがリンクします)。にプログラミングガイドを述語noreferrer">

scroll top