Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4124026
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:41:15+00:00 2026-05-20T23:41:15+00:00

Is there a way I can get ALL the views and subviews and subviews

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T23:41:15+00:00Added an answer on May 20, 2026 at 11:41 pm

    Here is a category on NSView:

    @interface NSView (MDRecursiveSubviews)
    - (NSArray *)md__allSubviews;
    @end
    
    @implementation NSView (MDRecursiveSubviews)
    
    - (NSArray *)md__allSubviews {
        NSMutableArray *allSubviews = [NSMutableArray arrayWithObject:self];
        NSArray *subviews = [self subviews];
        for (NSView *view in subviews) {
            [allSubviews addObjectsFromArray:[view md__allSubviews]];
        }
        return [[allSubviews copy] autorelease];
    }
    
    @end
    

    With a quick nib file I created with a view hierarchy, it printed this:

    [RecursiveSubviewsAppDelegate awakeFromNib] allSubviews == (
        "<NSView: 0x10390dfd0>",
        "<NSView: 0x103c07ae0>",
        "<NSView: 0x100129cc0>",
        "<NSButton: 0x100115ce0>",
        "<NSButton: 0x100116900>",
        "<NSButton: 0x1001165c0>",
        "<NSButton: 0x100116130>",
        "<NSButton: 0x100114ad0>",
        "<NSButton: 0x100115910>",
        "<NSButton: 0x100115090>",
        "<NSScrollView: 0x103b07a30>",
        "<NSClipView: 0x103b07d40>",
        "<NSTextView: 0x103b083c0>\n
    Frame = {{0.00, 0.00}, {159.00, 58.00}},
    Bounds = {{0.00, 0.00}, {159.00, 58.00}}\n
    Horizontally resizable: NO, Vertically resizable: YES\n
    MinSize = {159.00, 58.00}, MaxSize = {463.00, 10000000.00}\n",
        "<NSScroller: 0x1001145b0>",
        "<NSScroller: 0x100114840>",
        "<NSScrollView: 0x10390ea00>",
        "<NSClipView: 0x10390ef10>",
        "<NSTableView: 0x10390f570>",
        "<NSScroller: 0x103b06f10>",
        "<NSScroller: 0x103b07460>",
        "<NSClipView: 0x1039105d0>",
        "<NSTableHeaderView: 0x103910300>",
        "<_NSCornerView: 0x103911c20>"
    

    One note of concern I should add is that it’s unclear to me how this would be useful, except as a debugging tool. But even then, there are probably easier ways of doing things.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way I can ask Visual source safe to get all the
Is there a way I can get a date by the format MM/dd but
Is there any way I can get my Python code syntax highlighted in Microsoft
Is there any way I can get VS2008 to provide further detail on how
Is there any way I can get jQuery to perform a function when you
Is there any way I can get a share picker like the one seen
Is there a way I can get this array walk with my anonymous function
I wanted to ask if there is any way i can get path of
Is there a way in which I can get some information about the mounts
I can't believe I'm asking this but, is there any way to get Chrome

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.