1

我尝试在子视图中访问我的 UILabel 的文本

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

如何检查在这项研究中发现的 UILabel 的文本?

谢谢

4

1 回答 1

2

尝试:

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
        }
    } 
}

希望它可以帮助你..快乐编码:)

于 2013-10-27T09:45:05.500 回答