title: iOS Keyboard won't dismiss
body: <p>I have a form with textfield on my viewcontroller. When the user touches the textfield for adding their state I display a UIPicker for them to select one. Problem is if the keyboard is displayed from a previous textfield I can't get it to dismiss. Here is my code:</p>
  
  <pre><code>- (void) textFieldDidBeginEditing:(UITextField *)textField {
  
      if (self.currentTextField) {
          self.currentTextField = nil;
          self.currentTextField = (KIP_TextField*)textField;
      } else {
          self.currentTextField = (KIP_TextField*)textField;
      }
  
  
      if (self.currentTextField.tag == 0 || self.currentTextField.tag == self.arrSearchFields.count-1) {
  
          //kill the editing
          [self.view endEditing:YES];
          [self.currentTextField resignFirstResponder];
  
          //set the picker type
          if (self.currentTextField.tag == 0) {
              self.currentPickerType = SUPPLIER_PICKER;
          } else if (self.currentTextField.tag == self.arrSearchFields.count-1) {
              self.currentPickerType = STATE_PICKER;
          }
  
          if (!self.hasPicker) {
              [self addPicker];
          } else {
              [self closePicker:YES];
          }
  
      } else {
          [self closePicker:NO];
      }
  
  }
  </code></pre>
  
  <p>For those who responded with resignFirstResponder: I have that and it works, but I need the keyboard to be dismissed when I am displaying the picker. So there are 3 textfields, TF1, TF2, TF3, for TF1 and 2, touching them launches a picker, when the user selects a picker row, the textfield is populated with that value and the picker is dismissed. However, if you go to TF2 first, the keyboard is displayed, you can dismiss it by either the return key or texfieldDidEndEditing will dismiss it. But say you don't enter any text but touch TF1 or 3, the picker is now displayed but the keyboard is still on the screen. I can't get it to dismiss, even with self.view endEditing</p>