I use this code to set the uitextview options that I have in my view.
_textview=[[UITextView alloc]init]; [_textview setUserInteractionEnabled:FALSE]; _textview.text=@ "Write your message"; _textview.textColor=[UIColor lightGrayColor]; _textview.layer.cornerRadius=6; _textview.contentInset = UIEdgeInsetsZero; _textview.delegate=self;
I have this code in .h
IBOutlet UITextView *_textview; @property(nonatomic,retain) IBOutlet UITextView *_textview;
I connected the output to uitextview using the interface.
The following happens:
- (void)textViewDidChange:(UITextView *)inTextView
The above delegate is invoked, but not the following:
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementString:(NSString *)string
Why is this happening? Am I doing something wrong?
Any help appreciated ...
source share