views:

169

answers:

0

Hi, im working on a nstableview that contains information for some properties that are dynamicly created. Each row contains some cells that are common (name for example), but in one column they have different cells. Some properties will have NSSliderCell, other NSButtonCell etc. All of this is binded up to a NSDictionaryController. I've got the basics to work with nsslidercell and nsbuttoncell using -(NSCell *) tableView:(NSTableView *)tableView dataCellForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row in my delegate, and returning different cells for each row. And the nstablecolumn has a binding from the property's value (usually a nsnumber) to the value of the column.

This all works, but now i wanted to add a NSSegmentedCell to a new property type, and i experienced problems, because i now needed to bind the value of the property to the selectedIndex of the column, and not the value. But how can i do this without breaking the other properties?

I've also tried to subclass NSSegmentedCell, and make objectValue controlling the selectedIndex of it, but it didn't work...

Any ideas how to do this?