. NSApplication. AppDelegate, scrollview, .
NSObject xib AppDelegate. ( xcode , , "AppDelegate" "" "", FileOwner). " " scrollview . IBOutlet AppDelegate.
UPDATE:
, for. for , , . NSTimer, , .
, [scrollview documentView], [scrollview contentView]. .
, ,
, :
[scroll.contentView scrollToPoint:NSMakePoint(0, ((NSView*)scroll.contentView).frame.size.height - scroll.contentSize.height)]
[scroll reflectScrolledClipView: [scroll contentView]]
.
, .
, for, , xib, :
NSPoint pointToScrollTo = NSMakePoint ( 100,100 );
[[scrollview contentView] scrollToPoint: pointToScrollTo];
[scrollview reflectScrolledClipView: [scrollview contentView]];
Now run the application, set the scrollview scroll to a random position. Then press the button and check if the scroll is moved.
If this works, then your code is fine, you only need to set the points. It worked for me.
source
share