1
votes

I currently have an NSTableView inside an NSScrollView and this gets it's contents from a datasource. However, when the number of contents is larger than the view can hold, using the vertical scroll bar does not affect the contents of the table.

  • Dragging the scroll bar doesn't work
  • Clicking the Up/Down buttons doesn't work
  • Using the middle scroll wheel on a mouse does work
  • Using the arrows keys on the keyboard does work
  • The above two move the vertical scrollbar up and down

  • Tried Copy on Scroll On and Off

  • The NSTableView has two columns, one is a text field and the other is an image field

  • No errors appear in the console

This very much seems that the vertical scroll bar is connected to the table view, but only in one direction. That is the tableview changes the scrollbar but not vice versa.

Has anyone had such a problem before? Or know what could be causing it?

3

3 Answers

0
votes

Check the -target of the -verticalScroller (NSScroller) of the NSScrollView. It's probably nil. How did you create the NSScrollView? Have you read over the Scroll View Programming Guide?

0
votes

The problem here seems to have been caused by the NSTableView being in a NSCollectionView Prototype. I solved it by seperating the NSCollectionViewItem's View from the main nib into it's own so it now has it's own instance and scrolls properly.

0
votes

Same situation happened to me. Even my tableview's vertical scrollbar was not showing vertical. It was showing as horizontal scrollbar at the bottom right corner of the tableview. I fixed it by unchecking the "Automatically Hide ScrollBar" property of scrollview in the xib file.