Get ALL views and subview of NSWindow
Is there a way I can get ALL the views and subviews and subviews of these subviews (you get the idea...) of an NSWindow? Thanks. Here is a category on NSView: @interface NSView (MDRecursiveSubviews) - (NSArray *)allSubviews; @end @implementation NSView (MDRecursiveSubviews) - (NSArray *)allSubviews { NSMutableArray *allSubviews = [NSMutableArray arrayWithObject:self]; NSArray *subviews = [self subviews]; for (NSView *view in subviews) { [allSubviews addObjectsFromArray:[view allSubviews]]; } return [[allSubviews copy] autorelease]; } @end With a quick nib file I created with a view hierarchy,