2

Working on iPhone/iPad application, Problem: Keyboard not showing-up for UITextField in UITableViewCell in iOS 6.x, but same code works fine on iOS 5.x

We developed a UIViewController, in which we tableview is created. In this tableview, we have added textfield cell. So textfield shows the cursor, but it doesnot bring-up the keyboard, nor the cursor moves. (Every thing works fine on iOS 5.x)

UITableView *localTable=[[UITableView alloc]initWithFrame:tableFrame style:UITableViewStyleGrouped];
    self.tblScheduleBasicInfo=localTable;
    [localTable release];  //release the localTable
enter code here

@interface CustomTextFieldCell : UITableViewCell {
    UITextField *cellTextField;     
}

    CustomTextFieldCell *tfCell2;

    tfCell2=(CustomTextFieldCell *)[tableView dequeueReusableCellWithIdentifier:textFieldIdentifier1];

    if(tfCell2==nil)
     {
          tfCell2=[[[CustomTextFieldCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:textFieldIdentifier1]autorelease];
       }
                tfCell2.cellTextField.delegate=self;  //set the delegate to self to implement textField delegate methods in self
                tfCell2.userInteractionEnabled=YES;

The delegate is called, but keyboard does not show up.

We have tried following options mentioned in SO, but no luck yet

SO Link 1

SO Link 2

SO Link 3

All suggestions are welcome.. Many Thanks in advance.

Community
  • 1
  • 1
Rohit
  • 6,941
  • 17
  • 58
  • 102

1 Answers1

0

Until you tap on cell, your table cell will be the event responder. To make keyboard appear over text field, you need to make your text field to consume event respond as :

In tableView:didSelectRow:atIndex method :

[self.cellTextField becomeFirstResponder]
byJeevan
  • 3,728
  • 3
  • 37
  • 60