0
votes

I have 6 UITextFields created in Interface Builder. After entering the values, and clicking the search button, I need to dismiss the keyboard from the view. Currently I'm using 'findAndResignFirstResponder' and have delegates set for all text fields however the keyboard is not dismissing.

Any idea why this isn't working? Is there a better way to dismiss the keyboard?

4

4 Answers

0
votes

use this

[self.view endEditing:YES];

this will resign keypad from all fields

0
votes

in the IBaction "search"

    [Field1 resignFirstResponder];
    [Field2 resignFirstResponder];
    [Field3 resignFirstResponder];
    [Field4 resignFirstResponder];
    [Field5 resignFirstResponder];
0
votes

Try using [Field resignFirstResponder];

0
votes

You could try to assign a UITextField to the FirstResponder and after that to resign the FirstResponder:

 [someField becomeFirstResponder];
 [someField resignFirstResponder];