title: Programmatically dismissing textfield keyboard with delegate
body: <p>I have a viewController with this:</p>
  
  <p><code>@interface RootViewController : UIViewController &lt;UITextFieldDelegate&gt;{</code></p>
  
  <p>Then I have a textfield added programmatically like this in viewController.m:</p>
  
  <pre><code>UITextField*textFieldRounded=[[UITextField alloc] initWithFrame:frame];
  textFieldRounded.delegate = self;
  </code></pre>
  
  <p>In the same <code>.m</code> i have tried all of these:</p>
  
  <pre><code>- (void)textFieldDidEndEditing:(UITextField *)textField{
      [textField resignFirstResponder];
  NSLog(@"returned?");
  }
  
  - (BOOL)textFieldShouldReturn:(UITextField *)textField {
      [textField resignFirstResponder]; 
  NSLog(@"returned?");
   return YES;
  }
  
  -(BOOL)textFieldShouldEndEditing:(UITextField *)textField{
      [textField resignFirstResponder];
  NSLog(@"returned?");
      return YES;
  
  }
  </code></pre>
  
  <p>The keyboard appears fine when I click the text field, which is in a subview of the viewController. but pressing Done does nothing. The <code>NSLog</code> statements never appear, so these methods are never getting called. Any ideas?</p>