I want to iterate through all of the subviews in my view, and do something for each UIButton. This is the code i'm using (in the end of the viewDidLoad):
for(UIView* v in self.view.subviews)
{
if([v isKindOfClass:[UIButton class]])
{
NSLog(@"This is a button");
//DO SOMETHING FOR EACH BUTTOn
}
}
But the problem is that the "This is a button" line is never reached...
Why is that?