for (id view in [self.view subviews]) { if ([view isEqual:[UITextField class]]) { NSLog(@"你想要?"); } }