LoginSignup
1
0

More than 5 years have passed since last update.

NSViewController Hierarcy

Posted at

NSWindowControllerのcontentViewControllerからのNSViewControllerの階層表示

- (void)showViewControllerHierarchy:(NSViewController *)viewController level:(NSInteger)level
{
    if(!viewController) return;

    NSString *desc = [NSString stringWithFormat:@"<%p> %@", viewController, viewController];
    fprintf(stderr, "%*s%s\n", (int)level * 4, " ", desc.UTF8String);
    for(NSViewController *vc in viewController.childViewControllers) {
        [self showViewControllerHierarchy:vc level:level + 1];
    }
}

- (IBAction)showViewControllerHierarchy:(id)sender
{
    [self showViewControllerHierarchy:self.contentViewController level:0];
}
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0