views:

157

answers:

2

I want to keep my keyboard up after I input something since I am gathering up multiple answers for one question.

So far I am calling:

- (BOOL)textFieldShouldReturn:(UITextField*)textField {
  [textField resignFirstResponder];
  return YES;
}

But when remove resignFirstResponder, I am not getting any response for my input handler on this method:

- (void)textFieldDidEndEditing:(UITextField*)textField;

Anyone have an idea on how to deal with this?

A: 

Found my solution, in my

- (void)textFieldDidEndEditing:(UITextField*)textField;

I just make the textField back to first responder after it has been resigned:

[textField becomeFirstResponder];
Frank
A: 

Thanks for posting your reply, it got me pointed in the right direction. I found what I think is an easier solution:

- (BOOL)textFieldShouldEndEditing:(UITextField *)textField{
    return NO; // Don't hide keyboard
}

// Use "did end on exit" instead of "did end" since "did end" won't get fired
- (IBAction)textViewDidEndOnExit{
    // Do stuff here...
}

If you return NO from textFieldShouldEndEditing you don't need to call becomeFirstResponder afterwards.

(I tried posting this as a comment to your answer, but the code formatting doesn't work there...)

Loktar