0

I have an issue with the new Xcode 4.5 and iOS6. I have a form in my app with various textfields and pickers. I usually navigate through them with the Next key on the onscreen keyboard or pressing tab on my Mac, it seems something new affected the first responder because it doesn't work anymore:

-(UIResponder *)ValidarTextFieldwithCell:(UICellRegister *)Cell{
UIResponder* nextResponder;
UICellRegister *cell2;
NSIndexPath *nextIndexPath = [self nextIndexPath:Cell.MyIndexpath];
cell2= (UICellRegister *)[self.tableView cellForRowAtIndexPath:nextIndexPath];
nextResponder = cell2.Valor;
return nextResponder;
}


- (BOOL)textFieldShouldReturn:(UITextField *)textField   {


UICellRegister *myCell=(UICellRegister *)[[textField superview]superview];

UIResponder* nextResponder;


nextResponder = [self ValidarTextFieldwithCell:myCell];
if (nextResponder) {
    [nextResponder becomeFirstResponder];
} else {
    [textField resignFirstResponder];
    if ([self.parentViewController respondsToSelector:@selector(next:)]) {
        [((RegistroViewController *)self.parentViewController) next:nil];
    }
    if (![self.parentViewController isKindOfClass:[RegistroViewController class]]) {
        [self doneButtonPressed:nil];
    }
    [self animateView:NO withTextfield:nil];
    //        [self doneButtonPressed];
}
    return NO; // We do not want UITextField to insert line-breaks.
}

I'll appreciate any help.

jonathanwiesel
  • 1,036
  • 2
  • 16
  • 35
  • What do you mean by "it"? Does the keyboard appear but the return/next key doesn't work as it used to? Does the keyboard not appear? – Stephen Darlington Sep 25 '12 at 15:28
  • the keyboard and the keys appear but the focus doesn't change to the next field when the "next" button is pressed. Also the done button doesn't dismiss the keyboard anymore – jonathanwiesel Sep 25 '12 at 16:46
  • Anything like this? http://stackoverflow.com/questions/12447875/keyboard-and-cursor-show-but-i-cant-type-inside-uitextfields-and-uitextviews/12504575#12504575 – Stephen Darlington Sep 25 '12 at 18:01
  • tried it but still no luck, the next key still doesn't change the cursor to the next field – jonathanwiesel Sep 25 '12 at 18:46

1 Answers1

0

I managed to resolve the issue. I had overridden the textFieldEndEditing method (because of validations that are made of the current cell) that reloads the tableview at the end, the problem resided in that the tableview reloading was the cause of the next field not becoming the first responder. The solution was reloading only the cell I was validating.

jonathanwiesel
  • 1,036
  • 2
  • 16
  • 35