Guest User

Untitled

a guest
Dec 16th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. -(void) viewDidLoad{
  2.  
  3. // initialize object array with initialized UITextFields
  4. textfieldsArr = [[NSArray alloc] initWithObjects:nameField, address1Field, address2Field, cityField, stateField, zipField, nil];
  5. [self initializeTextBox];
  6. }
  7.  
  8. // Accessing the UITextField properties, using setLeftViewMode for example
  9. -(void) initializeTextBox {
  10.  
  11. for (int i = 0; i<[textfieldsArr count]; i++) {
  12. UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 5, 5)];
  13. [[textfieldsArr objectAtIndex:i] setLeftViewMode:UITextFieldViewModeAlways];
  14. [[textfieldsArr objectAtIndex:i] setLeftView:view];
  15. }
  16. }
Add Comment
Please, Sign In to add comment