iphone setting UITextView delegate breaks auto completion
- by Tristan
Hi there!
I have a UITextField that I would like to enable auto completion on by:
[self.textView setAutocorrectionType:UITextAutocorrectionTypeYes];
This works normally, except when I give the UITextView a delegate. When a delegate is set, auto complete just stops working. The delegate has only the following method:
- (void)textViewDidChange:(UITextView *)textView
{
self.textView.text = [self.textView.text stringByReplacingOccurrencesOfString:@"\n" withString:@""];
int left = LENGTH_MAX -[self.textView.text length];
self.characterCountLabel.text = [NSString stringWithFormat:@"%i",abs(left)];
}
Does anyone know how to have both auto complete enabled and a delegate set?
Thanks!Tristan