-1

I have a listview on the bottom part of the screen and a 4 field entry form at the top part of the screen. When I tap on the list item I would like to set focus to the 1st text field.

I have the code like this:

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:(NSIndexPath *)indexPath
{

    ....
    ....
    else if(editingStyle == UITableViewCellEditingStyleInsert)
        {
               [self clrscreen];

               [oDescription becomeFirstResponder];
            }

but it doesnt work. Do I have to get the focus out of the listview first or something

Mark Worsnop
  • 4,089
  • 14
  • 51
  • 73

1 Answers1

1

Maybe in the

[self clrscreen];

method you process the UI and the UITableView is redrawn. If that is so, at the moment you call the

[oDescription becomeFirstResponder];

it is not there. Please check if oDescription is not nil .

One more thing: where/when is this called:

....
....
else if(editingStyle == UITableViewCellEditingStyleInsert) ?
Daniel
  • 577
  • 2
  • 12
  • The clrscreen must have been the problem, I removed it and now all is good. Also I added the header of the method I was in above. thank you for the help! – Mark Worsnop Jul 12 '11 at 15:35