1

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?

Jonas Jongejan
  • 2,826
  • 1
  • 16
  • 17
  • “… in one column [the rows] have different cells.” Why? – Peter Hosey Mar 24 '10 at 16:14
  • I want to show some properties, and lets say i got one property that is controlled with a slider, another with a button (a state). So in the table i list all the properties, and in one column i want to have the controller (the slider or button or whatever controller it is).. Makes sence? – Jonas Jongejan Mar 25 '10 at 12:27

0 Answers0