Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scroll NSTableView to selection

OK, this is my situation :

  • I have an NSMutableArray bound to an NSTableView, via an NSArrayController.
  • I'm manipulating the table view's selection (trigger by keyboard), using NSArrayController's selectNext: and selectPrevious:

The thing is : The selection does change, but the table view doesn't scroll to the current selection, so that its content is visible.

What should I do? Any ideas?

like image 796
Dr.Kameleon Avatar asked Mar 08 '13 11:03

Dr.Kameleon


1 Answers

There is a method in NSTableView

- (void)scrollRowToVisible:(NSInteger)row;

That will scroll to the specified row.

like image 54
Anoop Vaidya Avatar answered Oct 23 '22 06:10

Anoop Vaidya