NSPopupButtonCell bindings issues
NSPopupButtonCell bindings issues
- Subject: NSPopupButtonCell bindings issues
- From: Kam Dahin <email@hidden>
- Date: Wed, 16 Aug 2006 17:10:26 -0700
Hello,
I am struggling with getting the selected value of one
NSPopupButtonCell to change the contents of another NSPopupButtonCell.
Here is a description of my model class and the bindings I am using:
Model class: PackNode
NSMutableArray *subNodesArray // this array contains instances of
SubPackNode
NSString *nodeName; // name of the node
I have a NSMutableArray in my main controller class named:
NSMutableArray *packNodesArray // holds PackNode instances
I have an NSArrayController called PackNodesController that is setup
to manage my PackNode class
This controller has its contentArray binding set to the following:
Bind To: File Owner
Controller Key: <blank>
Model Key Path: packNodesArray
I have another NSArrayController called SubNodesController that is
setup to manage my SubPackNode class
-- this class is just another PackNode class, but for clarity here, I
am calling it SubPackNode --
This controller has its contentArray set to the following:
Bind To: PackNodesController
Controller Key: selection
Model Key Path: subNodesArray
--- on to the Table View and NSPopUpButtonCells bindings ---
I have my two NSPopUpButtonCell's in my NSTableView setup as follows:
the NSPopUpButtonCell that displays each of my PackNode Objects is
setup with:
content:
Bind To: PackNodesController
Controller Key: arrangedObjects
Model Key Path: <blank>
contentValue:
Bind To: PackNodesController
Controller Key: arrangedObjects
Model Key Path: nodeName
selectedObjects:
Bind To: MediaFileController -- // manages another pure data class
Controller Key: arrangedObjects
Model Key Path: mediaName
the second NSPopUpButtonCell should display each of the SubPackNode
nodeNames stored in the currently selected PackNode -- this is not
working.
Here is the setup:
content:
Bind To: SubNodesController
Controller Key: arrangedObjects
Model Key Path: <blank>
contentValue:
Bind To: SubNodesController
Controller Key: arrangedObjects
Model Key Path: nodeName
selectedObjects:
Bind To: MediaFileController -- // manages another pure data class
Controller Key: arrangedObjects
Model Key Path: subMediaName
When I run my project, I get the first NSPopUpButtonCell showing all
of the PackNode names for each PackNode instance in my main
controller classes packNodesArray, which is correct.
In my second NSPopupButtonCell I get the names of each SubPackNode
object that live in the very first PackNode's subNodesArray, but if I
try to change the value in the first NSPopUpButtonCell, the second
NSPopUpButtonCell never updates. I have tried different settings to
get around this issue, experimented with adding a third
NSArrayController to handle the PackNode subNodesArray, but that
didn't work.
I know there is a lot of info here and it might be hard to visualize,
but I am hoping that someone could point out what i am doing wrong?
It seems like I am missing one piece of the puzzle, since my second
NSPopUpButtonCell is displaying the correct values for the first
PackNode, just can't get these values to change based on my selection.
Any ideas?
Thanks for reading this...
Regards,
k
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden