Reputation:
I have a sectioned table with dynamic number of rows per section. In each cell there is a text field. I need some advice or a nudge in the right direction for: saving text input in the text field after editing is done into a NSMutableArray. .
Upvotes: 0
Views: 331
Reputation: 44633
I am assuming you are setting the table view controller as the text field's delegate somewhere. Based on the comment, you can identify the cell the text field belongs to using,
- (void)textFieldDidEndEditing:(UITextField *)textField {
YourCustomCell * cell = (YourCustomCell *)textField.superview.superview;
NSIndexPath * indexPath = [self.tableView indexPathForCell:cell];
/* Use the index path to store the data in array or dictionary with the index path as key */
}
Upvotes: 1