1. 程式人生 > >遍歷子檢視中某個型別控制元件方法

遍歷子檢視中某個型別控制元件方法

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