textField:
-(BOOL) textFieldShouldReturn: (UITExtField *) textField;
textView:
- (BOOL) textView: (UITextView *) textView shouldChangeTextInRange: (NSRange) range replacementText: (NSString *)text {
if( [ @"\n" isEqualToString: text]){
//你的响应方法
return NO;
}
return YES;
}
}