Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You have programmed in wrong way.</p> <p>You are creating cell once and allocation text fields again and again, so they are overriding on each other.</p> <p>There are 2 options to solve this issue :-</p> <ol> <li>You can create custom cell class and declare all text fields there and just pass values here.</li> <li>You need to create cell every time.</li> </ol> <p>Hope this solution helps you.</p> <p>If you are opting for 2 one</p> <p>Here is code :-</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *cellIdentifier=@"CellIdentifier"; UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellIdentifier]; if (cell==nil) { cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier]; if (indexPath.row==languageName) { if (langNameTxtFld==nil) { langNameTxtFld=[[UITextField alloc]initWithFrame:CGRectMake(50,0, 265, 44)]; langNameTxtFld.delegate=self; [cell addSubview:[self addTextFieldWithText:nil textField:langNameTxtFld placeholder:@"Language Name" returnType:UIReturnKeyNext]]; } } else if (indexPath.row==region) { if (regionTxtFld==nil) { regionTxtFld=[[UITextField alloc]initWithFrame:CGRectMake(50,0, 265, 44)]; regionTxtFld.delegate=self; [cell addSubview:[self addTextFieldWithText:nil textField:regionTxtFld placeholder:[globalPlaceHolderDict valueForKeyPath:@"region_meaning"] returnType:UIReturnKeyNext]]; } } else if (indexPath.row==city) { if (cityTxtFld==nil) { cityTxtFld=[[UITextField alloc]initWithFrame:CGRectMake(50,0, 265, 44)]; cityTxtFld.delegate=self; [cell addSubview:[self addTextFieldWithText:nil textField:cityTxtFld placeholder:[globalPlaceHolderDict valueForKeyPath:@"city_meaning"] returnType:UIReturnKeyNext]]; } } else if (indexPath.row==school) { if (schoolsTxtFld==nil) { schoolsTxtFld=[[UITextField alloc]initWithFrame:CGRectMake(50,0, 265, 44)]; schoolsTxtFld.delegate=self; [cell addSubview:[self addTextFieldWithText:nil textField:schoolsTxtFld placeholder:[globalPlaceHolderDict valueForKeyPath:@"schools_meaning"] returnType:UIReturnKeyNext]]; } } else if (indexPath.row==studies){ if (studiesTxtFld==nil) { studiesTxtFld=[[UITextField alloc]initWithFrame:CGRectMake(50,0, 265, 44)]; studiesTxtFld.delegate=self; [cell addSubview:[self addTextFieldWithText:nil textField:studiesTxtFld placeholder:[globalPlaceHolderDict valueForKeyPath:@"studies_meaning"] returnType:UIReturnKeyNext]]; } } else if (indexPath.row==email) { if (emailTxtFld==nil) { emailTxtFld=[[UITextField alloc]initWithFrame:CGRectMake(50,0, 265, 44)]; emailTxtFld.delegate=self; [cell addSubview:[self addTextFieldWithText:nil textField:emailTxtFld placeholder:[globalPlaceHolderDict valueForKeyPath:@"email"] returnType:UIReturnKeyNext]]; } } else if (indexPath.row==passwords){ if (passwordsTxtFld==nil) { passwordsTxtFld=[[UITextField alloc]initWithFrame:CGRectMake(50,0, 265, 44)]; passwordsTxtFld.delegate=self; [cell addSubview:[self addTextFieldWithText:nil textField:passwordsTxtFld placeholder:[globalPlaceHolderDict valueForKeyPath:@"passwords"] returnType:UIReturnKeyNext]]; } } } } cell.backgroundColor=[UIColor whiteColor]; cell.selectionStyle=UITableViewCellSelectionStyleNone; return cell; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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