0
votes

Data: An entity with an attribute 'page' (int).

Interface:
NSSlider- value is bound to NotesController.selection.page
NSTableView- value of column 1 is bound to NotesController.arrangedObjects.page

I want to be able to interact with either component and have the change be reflected in both. Above setup works perfectly when I switch between rows in tableview (the slider goes to the corresponding value). However when I play around with slider it changes the value of the selected row instead of changing the index of selected row. This is obviously easily fixable with target/action but is there any workaround that only uses bindings? Thanks.

1
So dragging the slider should change which table row is selected? Could you perhaps post a screenshot of your interface? I'm thinking you'll have to bind to selectionIndexes: and use a value transformer to create an NSIndexSet. - Francis McGrew
Yes. Dragging the slider should change which table row is selected. I can post a screenshot but there is really nothing to the interface. It's just a default slider and a table view. How do I bind to selectionIndex? The only relevant binding in NSSlider is 'value' and as I explained above unfortunately that doesn't fully work - Lukasz

1 Answers

1
votes

You need to bind your slider's value to NotesController.selectionIndex.