Flash NSScrollView scrollers on launch


#1

On iOS, UITableView is a subclass of UIScrollView. This gives us the ability to call -flashScrollIndicators on the table view object. Looking through the NSTableView docs, NSTableView is a subclass of NSControl and not NSScrollView. SInce NSTableView is embedded in an NSScrollView I assumed (probably not good) that I could use code like this to access the NSScrollView for purposes of flashing the scrollers on OS X Lion.

id sv = [_tableView superview];
    
    if ([sv isKindOfClass:[NSScrollView class]]) {
        
        [sv flashScrollers];
    }

Although this code works in -(void)applicationDidFinishLaunching:(NSNotification *)aNotification , you could uncheck Automatically Hide Scroller in IB attributes and the NSScrollView will flash the scrollers as well. This attribute seems to coincide with - (void)setAutohidesScrollers:(BOOL)flag. So my questions follow: Is this code acceptable (not that I would prefer code to a setting in IB) and if I wanted to customize the NSScrollView beyond what is allowed in IB I would create an IBOutlet correct? Suggestions appreciated!