title: UITextField in UIAlertView on iPhone - how to make it responsive?
body: <p>I placed a UITextField into a UIAlertView and moved it up so the keyboard wouldn't cover it up with the following code:</p>
  
  <pre><code>[dialog setDelegate:self];
  [dialog setTitle:@"Enter Name"];
  [dialog addButtonWithTitle:@"Cancel"];
  [dialog addButtonWithTitle:@"OK"];
  UITextField * nameField = [[UITextField alloc] initWithFrame:CGRectMake(20.0, 45.0, 245.0, 25.0)];
  [nameField setBackgroundColor:[UIColor whiteColor]];
  [dialog addSubview:nameField];
  CGAffineTransform moveUp = CGAffineTransformMakeTranslation(0.0, 100.0);
  [dialog setTransform: moveUp];
  [dialog show];
  </code></pre>
  
  <p>I also have the following code to deal with the alert view:</p>
  
  <pre><code>- (void) alertView:(UIAlertView *)alert clickedButtonAtIndex:(NSInteger)buttonIndex{    
      NSLog(@"%d", (int) buttonIndex);
      if (buttonIndex == 1) { // OK pushed
          NSLog([alert textField].text); // does not log anything
      } else {
          // Cancel pushed
  }}
  </code></pre>
  
  <p>I also have a UIAlertViewExtended.h file that contains:</p>
  
  <pre><code>@class UITextField, UILabel;
  
  @interface UIAlertView(Extended)
  
  -(UITextField *)textField;
  
  @end
  </code></pre>
  
  <p>My question is how do I get the text the user entered and how do I dismiss the keyboard?</p>
  
  <p>Thanks,
  Ben</p>