Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Easier way to call NSBrowser's delegate from browser matrix?



In my implementation of browser drag-n-drop, my brower matrix class needs to send a -performSelector: to the browser's delegate when dragging begins. The view hierarchy in a browser is especially deep. Starting at the top, it goes:

NSBrowser
_NSBrowserScrollView
NSClipView
_NSBrowserColumnsContainerView
_NSBrowserColumnView
NSClipView
MyBrowserMatrix

So, for an instance of MyBrowserMatrix to call the browser's delegate, I'm using:

- (id)browserDelegate
{
return [(NSBrowser *)[[[[[[self superview] superview] superview] superview] superview] superview] delegate];
}


which seems somewhat ludicrous. There must be a smarter way?

Regards,
Jeremy

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.