NSButtonCell and NSArrayController - argument and arrangedObjects
NSButtonCell and NSArrayController - argument and arrangedObjects
- Subject: NSButtonCell and NSArrayController - argument and arrangedObjects
- From: Duncan Oliver <email@hidden>
- Date: Wed, 14 Jan 2004 11:28:06 -0600
I've been haven't a bit of trouble trying to get this to work. I was
hoping someone could point out what I was doing wrong.
I have a document-based nib file with a TableView that has two columns,
one titled "name" and another entitled "color". I have a
programmatically created NSArrayController named priorities that is
part of the File's Owner. Here's how everything is bound:
TableView content - File Owner priorities.arrangedObjects
TableView selectionIndexes - File Owner priorities.selectionIndexes
"name" TableColumn value - File Owner priorities.arrangedObjects.name
Everything there works fine. Here's where it's tricky. The "color"
column's data cell is an NSButtonCell with the following bindings:
"color" TableColumn target - File Owner self
"color" TableColumn argument - File Owner priorities.arrangedObjects
The target is selected fine, but the button keeps trying to pass an
array of objects instead of the corresponding object for that index. I
also tried adding a method to the class that the NSArrayController
manages that returns itself but the following connection
"color" TableColumn argument - File Owner
priorities.arrangedObjects.priority
still doesn't work. Is there anyway to get a button cell's argument
binding to refer to the object that corresponds to it's rowIndex, or
does button cell not work like text field cell in that matter? Has
anyone had luck with something similar? Thanks for the help.
Duncan Oliver
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.