views:

396

answers:

2

I have a UIViewController that implements UITextViewDelegate and is connected as the delegate to my UITextView. Whenever the text view is tapped, I get a call to:

 - (void)textFieldDidBeginEditing:(UITextField *)sender

and whenever the contents of the view change (keyboard, programmatic modification), I get calls to:

 - (void)textViewDidChange:(UITextView *)textView

But when I hit the Return key on the keyboard, I am not getting a call to:

 - (BOOL)textFieldShouldReturn:(UITextField *)textField

Is there something different about this method? Is there something special that needs to be set somewhere to make sure I get this call?

Thanks in advance!

A: 

Yep, different delegate.

Marplesoft
A: 

Better to use keyboard notifications instead of using delagates. Register your viewController as observer for that notification. I am pretty sure that it sounds good.

smurali