I figured out how to do this and wanted to post it here in case anyone else has the same question.
First, make sure to set the controller as the UITextField's delegate in your .h file ( make sure the controller uses the UITextFieldDelegate protocol ).
Code:
@interface YourViewController : UIViewController <UITextFieldDelegate>
Then in the .m file set the delegate, I do this in viewDidLoad:
Code:
textfield.delegate = self;
Finally override the textFieldShouldReturn method, you want it to do whatever you need done when input is entered but it should return NO to prevent the textfield from resigning first responder status. My example clears the textfield, calls a method that will process the new input and then returns NO:
Code:
- (BOOL)textFieldShouldReturn:(UITextField *)tf{
[self processInput:tf];
[tf setText:@""];
return NO;
}
Thats it, keyboard stays up once the textfield becomes first responder...
-Andy