Make sure the "Done" button for the keyboard resigns first responder. You can do that with the textFieldShouldReturn method.
You can also modify the keyboard that gets displayed for your text field if you want it to display a "Done" button.
Look up the UITextField "keyboardType" property in the documentation.