I'm trying to add 2 segments
to an array
, then loop through its subviews. Here is my code:
NSArray *myArray = [[NSArray alloc] initWithObjects:[self.segment.subviews objectAtIndex:0],
[self.dataSegmentedControl.subviews objectAtIndex:1], nil];
for (id innerView in myArray) // I tried "myArray.subviews" but it didn't let me do ".subviews"
{
if ([innerView isKindOfClass:[UILabel class]]) {
...
}
}
When I insert an NSLog
in the if statement
, I don't get any output. What can I do to fix that?: