How can I stop NSTableView to keep current scroll position?

In my application, I have NSTableViewin NSViewController, and NSArrayController- the content.

This works fine, however, when I go to some position of the table, terminate the application and restart it, it restores the last scroll position. I do not like this behavior, I want him to stay upstairs.

I tried setAutosaveTableColumnsNO in NSTableView, it seems this is not the option I need. He still works the old way.

Is there an option to disable this?

+3
source share
1 answer

NSScrollView, encodeRestorableStateWithCoder:/restoreStateWithCoder:, OS X Lion.
(Interface Builder NSScrollViewNSClipViewNSTableView).

, , :

  • Interface Builder: enter image description here
  • NSScrollView encodeRestorableStateWithCoder: ( IB):
  • , :

    - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
    {
        [[self.scrollView contentView] scrollToPoint:NSMakePoint(0.0, 0.0)];
        [self.scrollView reflectScrolledClipView:[self.scrollView contentView]];
    }
    

3, , , 2 Apple [super encodeRestorableStateWithCoder:] NSView.

+5

All Articles