iphone setting UITextView delegate breaks auto completion

Posted by Tristan on Stack Overflow See other posts from Stack Overflow or by Tristan
Published on 2010-03-24T23:45:26Z Indexed on 2010/03/24 23:53 UTC
Read the original article Hit count: 753

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

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uitextview