Created
November 2, 2010 16:25
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(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