Question

I try to access to the text of my UILabels in subviews

for (UIView *myView in recognizer.view.subviews) {
     ...
            }

How can I check the text of my UILabels found in this research?

Thanks

Était-ce utile?

La solution

Try:

for (UIView *myView in recognizer.view.subviews) {
    if([myView isKindOfClass: [UILabel class]]){
        //check ur Label text here
        UILabel * myLabel = (UILabel *) myView;
        if ([myLabel.text isEqualToString: @"Your String"])
        {
            //GO For Ur Logic Here
        }
    } 
}

Hope it helps you.. happy coding :)

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top