Created
November 17, 2010 11:40
-
-
Save mikeplate/703297 to your computer and use it in GitHub Desktop.
Find all subviews and concatenate a string of all class names, iOS
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)viewDidLoad { | |
[super viewDidLoad]; | |
NSMutableString* nameList = [[NSMutableString alloc] init]; | |
for (UIView *subview in [self.view subviews]) { | |
NSString* name = NSStringFromClass([subview class]); | |
if ([nameList length] > 0) | |
[nameList appendString:@", "]; | |
[nameList appendString:name]; | |
} | |
[_showLabel setText:nameList]; | |
[nameList release]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment