title: How can I read UITextField value in an IBAction. I'm creating UITextField programmatically
body: <p>How can I read <code>UITextField</code> value in an <code>IBAction</code>? I'm creating <code>UITextField</code> programmatically. So I can't set <code>@property</code> and <code>@synthesize</code> using Xcode. The code to generate <code>UITextField</code> is as follows:</p>
  
  <pre><code>for(i=0; i&lt;[fieldName count]; i++)
  {
      UITextField *name = [fieldName objectAtIndex:i];
      frame = CGRectMake(fromLeft, fromTop, totalWidth, totalHeight);
      name = [[[UITextField alloc] initWithFrame:frame] autorelease];
      name.borderStyle = UITextBorderStyleRoundedRect;
      name.returnKeyType = UIReturnKeyDone;
      //name.placeholder = [fieldName objectAtIndex:i];
      name.autocapitalizationType = UITextAutocapitalizationTypeWords;
      name.adjustsFontSizeToFitWidth = TRUE;
      name.keyboardType = UIKeyboardTypeDefault;
  
      [name addTarget:self action:@selector(doneEditing:) forControlEvents:UIControlEventEditingDidEndOnExit];   
      [scroller addSubview:name];
      fromTop = fromTop + 40;
  }
  </code></pre>
  
  <p>Now I want to read values of each textbox in a button click (<code>IBAction</code>). Can anyone help me please?</p>