I have two fields, fldPassword and fldUsername. With this code (and a self delegate in the view did load), I would expect the return key to dismiss at both of the text fields. However, it only does it on the first. What am I doing wrong?
- (BOOL)textFieldShouldReturn:(UITextField *)theTextField {
if (fldPassword == self->fldPassword) {
[fldPassword resignFirstResponder];
} else if (fldUsername == self->fldUsername) {
[self->fldUsername becomeFirstResponder];
}
return YES;
}
You are dismissing only the fist one, try this: