Thursday 15 March 2012

cocoa touch - How do I iterate over all controls in a View -


I have a stable table view controller. Within some cells, I have text boxes. I would like to enable or disable I know that I can do something like this

  self.nameTextField.Enabled = NO; Self.ageTextField.Enabled = NO; Self.hairColorTextField.Enabled = NO;   

But something should be more beautiful for some

  (self control UIControl *. All childcantrols) {// < - I have completely created that up ([Control is KindOfClass: [UITextField class]]) {control.Enabled = NO; }}   

I do not think I am asking the right question ...

You can use the SubView property AUDI UIView. It contains all the hair UI elements.

  @property (nonatomic, readonly, copy) for NSArray * SubView   

  (UIView * subview in Self.view.subviews) {// check class or tag}    

No comments:

Post a Comment