Note that there are some explanatory texts on larger screens.

plurals
  1. POwhile i am entering text in one field it is diplaying same text in some other textfield too
    text
    copied!<p>When I am entering text in textfield 1 that text is also displayed in textfield 9.</p> <p>here is some code what i did to create textfield in tableview cell.</p> <p>i added textfield in tableview cell .like below in cellforRowatintexpath method </p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ static NSString *CellIdentifier = @"myCell"; //UILabel* nameLabel = nil; cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if(cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; cell.selectionStyle = UITableViewCellSelectionStyleNone; } else { UILabel *titleLbl = (UILabel *)[cell viewWithTag:1]; [titleLbl removeFromSuperview]; } nameLabel = [[UILabel alloc] initWithFrame:CGRectMake( 7.0, 10.0, 160.0, 44.0 )]; nameLabel.text = [labels objectAtIndex:indexPath.row]; nameLabel.font = [UIFont boldSystemFontOfSize:12]; nameLabel.lineBreakMode = UILineBreakModeWordWrap; nameLabel.tag =1; nameLabel.numberOfLines =0; [nameLabel sizeToFit]; CGSize expectedlabelsize = [nameLabel.text sizeWithFont:nameLabel.font constrainedToSize:nameLabel.frame.size lineBreakMode:UILineBreakModeWordWrap]; CGRect newFrame =nameLabel.frame; newFrame.size.height =expectedlabelsize.height; [cell.contentView addSubview: nameLabel]; [nameLabel release]; //adding textfield to tableview cell. tv = [[UITextField alloc] initWithFrame:CGRectMake(nameLabel.frame.origin.x+nameLabel.frame.size.width+2, 10.0, cell.contentView.bounds.size.width, 30)]; tv.tag = indexPath.row + 2; //tv.text =[labels objectAtIndex:indexPath.row]; tv.font = [UIFont boldSystemFontOfSize:12]; //this method will take text from textfield of tableview cell using their individual tag [tv addTarget:self action:@selector(getTextFieldValue:) forControlEvents:UIControlEventEditingDidEnd]; [cell.contentView addSubview:tv]; [tv setDelegate:self]; [tv release]; return cell;} </code></pre> <p>and here is the method getTextFieldValue method </p> <pre><code>- (void) getTextFieldValue:(UITextField *)textField{ if (textField.tag == 2) { //NSString *value1 = [NSString stringWithFormat:@"%@",textField.text]; //NSLog(@"value1 is %@",value1);. NSLog(@"2---&gt;%@",textField.text); }else if(textField.tag == 3){ NSLog(@"3---&gt;%@",textField.text); }else if(textField.tag == 4){ NSLog(@"4---&gt;%@",textField.text); } else if(textField.tag == 5){ NSLog(@"5---&gt;%@",textField.text); } else if(textField.tag == 6){ NSLog(@"6---&gt;%@",textField.text); } else if(textField.tag == 7){ NSLog(@"7---&gt;%@",textField.text); } else if(textField.tag == 8){ NSLog(@"8---&gt;%@",textField.text); } else if(textField.tag == 9){ NSLog(@"9---&gt;%@",textField.text); } else if(textField.tag == 10){ NSLog(@"10---&gt;%@",textField.text); } else if(textField.tag == 11){ NSLog(@"11---&gt;%@",textField.text); } else if(textField.tag == 12){ NSLog(@"12---&gt;%@",textField.text); } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload