I have an NSScrollView subclass and I would like to update another NSView based on the current scroll position. I tried KVC-observing the val
Tell the scroll view's content view to post bounds changed notifications, then listen for NSViewBoundsDidChangeNotification.
[[aScrollView contentView] setPostsBoundsChangedNotifications:YES];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(boundsDidChangeNotification:)
name:NSViewBoundsDidChangeNotification
object:[scrollView contentView]];
As stated in the Scroll View Programming Guide, you can get the current scroll position this way:
NSPoint currentScrollPosition = [[theScrollView contentView] bounds].origin;