开发者

UITextView Delegate shouldChangeTextInRange (or any over) doesn't get called

I need to track changes in my UITextView method (actianly for limiting number of lines), but none of UITextViewDelegate methods are being called when editing in UITextView begins. Not even - (void)textViewDidChange:(UITextView *)textView;

I dont know what Im doing wrong

I added UITextViewDelegate method to header file like that:

@interface PirmasViewController : UIViewController <UITextViewDelegate, MFMa......

And I put any methods for tracking changes in my implementation file:

- (void)textViewDidChange:(UITextView *)textView{NSLog(@"something changed");}

- (BOOL)textView:(UITextView *)aTextView shouldChangeTextInRange:(NSRange)aRange replacementText:(NSString*)a开发者_开发百科Text{ NSLog(@"something changed"); return YES; }`

but no rezults.


I was missing one line of code:

UITextViewFieldName.delegate = self;
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜