I've just created my first view-based NSTableView
in Interface Builder and I've correctly set up the data source and the bindings to update the views in the tableview. Each view has two labels and a NSProgressIndicator
. Updating the progress indicator through the bindings and the data source works perfectly, but I'd like to change its state from determinate to indeterminate at some time. As my NSTableCellView
subclass has access to the progress indicator, how can I get access to the cell view at a given row index? I've tried calling viewAtColumn:row:makeIfNecessary:
on the tableview with both NO and YES for the makeIfNecessary
argument, but neither seems to work.
1
votes
2 Answers
1
votes
Solution 1: In your NSTableCellView
subclass add a property (IBOutlet
) for your NSProgressIndicator
control. Wire it in IB to set the property when the view is loaded. You can then access the progress control in your cell view subclass by using the property.
Solution 2: In IB give your NSProgressIndicator
a unique integer tag. In your cell view subclass use [self viewWithTag:]
to get the object.