2009-12-04 2 views
0

하나의 코어 데이터 엔티티에서 NSPopUpButton 항목으로 데이터를 공급하여 다른 코어 데이터 엔티티를 선택하는 방법은 잘 알고 있습니다. 바인딩과 같이하십시오 NSPopUpButton에 표시되는 값에 대한NSPopUpButton 목록에 나타나는 코어 데이터 엔티티의 항목 필터링

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

:

-> 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 엔티티에서 당기고 있으며 남성 또는 여성 사용자를 나열하고 싶다고 가정).

답변

2

NSArrayController는 인터페이스 작성기 또는 코드 (링크 된 문서의 메소드를 통해)에서 설정할 수있는 "filter predicate"을 가지고 있습니다. Predicates Programming Guide을보고 원하는 필터에 대해 어떤 조건자를 제공해야하는지 알아보십시오.