How can I see the components of a view within another view? As I see the components of the main view:
NSArray *sub = [self.view subviews];
if ([sub count] == 0) return;
for (int i=0; i<sub.count; i++){
NSLog(@"Subview: %@", sub[i]);
}
And if you give me the components that have that view but what happens if that view has another view inside with other subviews as I can identify them, and try with:
NSArray *sub = [self.view subviews];
if ([sub count] == 0) return;
for (int i=0; i<sub.count; i++){
if ([sub[i] isKindOfClass:[UIView class]]) {
NSArray *sub1 = [sub[i] subviews];
for (int x=0; x<sub1.count; x++){
NSLog(@"ssssssss:::::::::::%@", sub1);
}
}
}
But it is not that it does not work, but it recognizes the buttons as SUBVIEW and pulls the component that has inside let's say that if the button has an image it tells me that inside it has a UIImageview and if it has text a UIButtonLabel explain to me what is it what happens and how to get only the ones that UIView has at that moment, ONLY from the UIView.