遍历子视图中某个类型控件方法

    NSMutableArray *textFieldArray = [NSMutableArray arrayWithCapacity:5];
    
    for (UIView *textField in self.view.subviews) {
        if ([textField isKindOfClass:[UITextField class]]) {
            [textFieldArray addObject:textField];
        }
    }

用isKindOfClass判断指定类型

posted on 2014-06-09 22:49  馅饼在哪颗星  阅读(211)  评论(0编辑  收藏  举报

导航