I have a UIAlertView containing a UITextField:
UITextField *textField = [alertView textFieldAtIndex:0];
Now I want to set the inputDelegate property for the textField:
[textField setInputDelegate:self];
My view controller (self) conforms to UITextInputDelegate and it has the method
- (void)textDidChange:(id<UITextInput>)textInput;
but for some reason this method is never called when I change the text in the textField. So I assume that my view controller is not set as the textField's inputDelegate.
The documentation states:
The text input system automatically assigns a delegate to this property at runtime. It is the responsibility of the view that adopts the UITextInput protocol to notify the input delegate at the appropriate junctures.
Does that mean that I cannot change the inputDelegate of a text field?
How can I achieve that the textField really calls the delegate method textDidChange:
in my view controller whenever its contents change?