开发者

how does UITextView delegate knows when to call textViewDidEndEditing

I am developing an application in which i need to call a particular method when user hits return button.I am using UITextView. Now the problem is that when I hit return key ,cursor goes to next line and I am not able to retrieve the action in my code. I tried to write the same code in textViewDidEndEditing: delegate method but it looks as if we cant find when and at what action this particular method is called...Can someone help in with any of开发者_JAVA技巧 above approach?


To detect the return key, you could implement the following delegate method:

- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text

Simply check text for a newline and proceed as desired.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜