0

I have 10 sections and each section has only 1 row. Row contain 5 text fields. if I change any text field value how to update to particular row ?

It should not effect to another sections rows. I have taken customview for cell designing.

1 Answers1

0

Check the https://stackoverflow.com/a/2... answer. Set the tag for textfield and use Dictionary to store values, Otherwise the reusing cell the textfield text re-appearing in other cells.

cellForRowAtIndexPath return section and row... Do your own logic in Dict to store textfield values...

[txtfield addTarget:self  action:@selector(textFieldDidChange:)    forControlEvents:UIControlEventEditingChanged];

-(void)textFieldDidChange:(UITextField *)txtField
 {
 UILabel *label = (UILabel *)[txtField.superview viewWithTag:100];
 NSString *labelString = label.text;
 NSString *textFieldString = txtField.text;
 [amounts setObject:textFieldString forKey:labelString];
 }

Maintain unique key for cell or textfield to store in dict, check the dict for key exist, if exist change the value else add new key with value.

I think this is, what you want...Do your best...

Community
  • 1
  • 1
Mohamed Jaleel Nazir
  • 5,776
  • 3
  • 34
  • 48