views:

33

answers:

1

To dismiss the keyboard I use either one of the following:

[sender dismissFirstResponder]
[self dismissFirstResponder]

The problem is, I have a situation where the user selects a text field, and some other text field is the first responder with the keyboard showing. I want to dismiss the keyboard when this particular text field is selected. So neither of these will work to dismiss the keyboard.

How can I dismiss the keyboard if I don't know who is the first responder?

+2  A: 

See this answer for how to find the current first responder.

Daniel Dickison