Skip to content

Instantly share code, notes, and snippets.

@johnmckerrell
Created November 2, 2010 16:25
Show Gist options
  • Save johnmckerrell/659893 to your computer and use it in GitHub Desktop.
Save johnmckerrell/659893 to your computer and use it in GitHub Desktop.
Very basic method for dumping out a view hierarchy so that you can see what's going on.
-(void) dumpView:(UIView*)parentView indent:(NSInteger)indent {
NSMutableString *indentString = [NSMutableString stringWithCapacity:indent];
for (NSInteger i = 0; i < indent; ++i) {
[indentString appendString:@" "];
}
NSLog(@"%@%@", indentString, parentView);
UIView *childView = nil;
for (childView in parentView.subviews) {
[self dumpView:childView indent:indent+1];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment