If your are using UITextView, and have header interface implementing <UITextViewDelegate> the answer is different than for a textfield. Often it is best to have a button above the keyboard to dismiss it, but you can trigger return from the DONE/return key:
Code:
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range
replacementText:(NSString *)text
{
int charINTtyped=0;
if([text length]>0){
charINTtyped=(int)[text characterAtIndex:0];
}
if(charINTtyped==10){
[textView resignFirstResponder]; //dismiss the keyboard
return NO;//don't insert return into textView.text
}
return YES;
}