- uitextview 的处理
- - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
- {
- if([text length] != 0) //点击了非删除键
- {
- return YES;
- }
- else
- {
- text ; // 按键对应的str
- //you code
- return YES;
- }
- }
2.UITextField 的处理
- - (BOOL)textFieldShouldClear:(UITextField *)textField; // called when clear button pressed. return NO to ignore (no notifications)
- - (BOOL)textFieldShouldReturn:(UITextField *)textField; // called when 'return' key pressed. return NO to ignore.