NSPopUpButtonリストに表示されるコアデータのエンティティからのフィルタリングエントリ
-
12-09-2019 - |
質問
私はそれが別のために選択することができるように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">
所属していません StackOverflow