views:

67

answers:

1

I have a keyboard which edits text in a UITextView and tapping the return key doenst dismiss the keyboard, it only moves down to the next line.

How can I add a done button and make that dismiss the keyboard?

+1  A: 

Implement the textView:shouldChangeTextInRange method to look for "\n" then call resignFirstResponder on the textView if it is found.

From http://iphonedevelopertips.com/cocoa/how-to-dismiss-the-keyboard-when-using-a-uitextview.html

Bemmu
I already do that and it doesnt work.
alJaree
Had to link the delegates in IB :)
alJaree