Question

I'm trying to create a view that's similar to Motion's properties views.

ScreenShot

Each of my property objects contains a definition of the kind of cell it wants to display as. But at the same time, I'd like to use bindings so that values are automatically updated as they can be changed elsewhere.

I've tried a few different approaches to the problem.

  • Multiple cells and dataCellForTableColumn: while this allows rendering to happen properly for all cell types, I lose bindings.

  • NSProxy: I've also tried using a proxy object that I thought would forward all methods to the selected cell type behind it, but again, bindings don't seem to work here.

Has anybody had any experience with this kind of problem before? Or is this one of the cases where bindings isn't going to cut it, and I'll need to do the heavy lifting myself?

Cheers!

Was it helpful?

Solution

I haven't actually tested it, but you shouldn't be losing bindings when you use dataCellForTableColumn:row: ? Can you describe in a bit more detail what you've tried with respect to bindings?

You should be able to set the column's value binding to the "value" property of your object. Then if you return the correct type of cell in dataCellForTableColumn:row: it should display correctly.

Edit: --- deleted gratuitous incorrect advice about cells vs views :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top