I have a NSCollectionView based master-detail interface, where I want to display Boards in the master and Lists+Cards in the detail view.
Board
, holds a NSMutableArray
property lists
of type List
List
, holds a NSArray
property cards
of type Card
Card
, has a NSString
property name
The relationship is thus Board --> to-many List --> to-many Card
The master interface is fine.
The detail interface gets populated with corresponding Lists' titles for a Board. Within the detail interface I also want to populate a NSPopupButton with the cards for every list.
Problem: the NSPopupButton is empty.
Output: [<__NSArrayI 0x60000007b240> addObserver:forKeyPath:options:context:] is not supported. Key path: name
So after reading KVO, KVC and the Bindings documentation I am not sure if I need to do manual KVO for this sort of hierarchical model. Also the output hints that the name property is not KVC/KVO compliant, but it's just a NSString?
Do you suggest using an NSTreeController for this?
Bindings are setup like so:
BoardArrayController -> bound to File's owner
- ** Model key path: boards
ListArrayController -> bound to BoardArrayController
- ** Controller key: arrangedObjects
- ** Model key path: lists
- ** Mode: Class
CardArrayController -> bound to ListArrayController
- ** Controller key: arranged Objects
- ** Model key path: cards
- ** Mode: Class
The NSPopupButton has
- Controller key for Content: arrangedObjects
- Controller key for Content Value: arrangedObjects and model key path: name
Suggestions please