I am using a custom inputView for some textfield, however when i call resignFirstResponder on the textfield, the custom input view does not dismiss...any suggestions?
UITextField *f=[[UITextfield alloc] init];
UIView *view=[[UIView alloc] initWithFrame..];
[f setInputView:view]; //random example of how to set a textfields input view to a custom view
After some research, this issue only occurs when working with a viewController thats presented in a modal view...it works ok otherwise...
Thanks
-Daniel
Instead of calling
resignFirstResponder, you should callendEditing:on the view itself or any of its superviews.endEditing:will search all subviews for any view that has first responder status, and ask it to resign.endEditing:takes a boolean flag as a parameter. If set, it will force the first responder to resign; otherwise, you can allow it to keep focus (if input is invalid, for example). For a UITextField, this is determined by the delegate'sshouldEndEditing:method.In general, a good pattern to use is: