Is there a simple way to walk back up the NSView hierarchy (superview of superview of superview of nsview) to the main window or a point in between?
Thanks
NSView *aView = myView;
while ((aView = [aView superview])) {
NSLog(@"%@", aView);
}
A view won't necessarily have anything to do with “the main window”, for any definition of that term, but you can get the window that a view is in by simply asking it.