title: Hiding Keyboard in iphone resingFirstResponder Not working
body: <p>I have create UITextField with alert view. After typing on UITextField I want to hide keyboard when user click "done" button. </p>
  
  <p>This is my code. When I run it it's hitting the hideKeyBoard method (I found out using NSLog and the debugging). But this code not hiding the keyboard. Please Help me. </p>
  
  <pre><code>- (IBAction)doAlertInput:(id)sender
  {
      UIAlertView *alertDialog;
  
      alertDialog = [[UIAlertView alloc] 
                     initWithTitle: @"Please Enter Your Email Address!" message:@"You won’t see me" 
                     delegate: self cancelButtonTitle: @"Ok" otherButtonTitles: nil];
  
      userInput=[[UITextField alloc] initWithFrame: CGRectMake(12.0, 70.0, 260.0, 25.0)];
  
      userInput.returnKeyType = UIReturnKeyDone;
  
      [userInput addTarget:self action:@selector(hideKeyBoard) forControlEvents:UIControlEventEditingDidEndOnExit];
  
      [userInput setBackgroundColor:[UIColor whiteColor]];
  
      [alertDialog addSubview:userInput];
  
      [alertDialog show];
      [alertDialog release];
  }
  
  -(void)hideKeyBoard
  {
      [userInput resignFirstResponder];
      NSLog(@"Key Board Hid");
  }
  </code></pre>