Skip to content

Instantly share code, notes, and snippets.

@mikeplate
Created November 17, 2010 11:40
Show Gist options
  • Save mikeplate/703297 to your computer and use it in GitHub Desktop.
Save mikeplate/703297 to your computer and use it in GitHub Desktop.
Find all subviews and concatenate a string of all class names, iOS
- (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