문제

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

도움이 되었습니까?

해결책

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 :)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top