I have a TableView (named myTableView) that contains prototype cells (named: TableCell) inside a ViewController (not TableViewController, named: ViewController).
Each cell has 4 different textfields that display data from different NSMutableArrays (declared in ViewController.h and named: Legajos, Nombres, Cbus, Sueldos, Contribuciones), so for example the cell at row 0 will display the objects at index 0 from Legajos, Nombres, etc... All of this is working, I am even able to add and delete rows with no problem.
Now my problem. I have textfields (declared TableCell.h) that display text from NSMutableArrays (declared in ViewController.h), but I was only able to make it a "one way trip", that is to say, the textfields only show text from the NSMutableArrays but I also need them to modify the NSMutableArray so I can save that array and then load it.
The NSMutableArrays declaration: (ViewController.h)
@property (strong, nonatomic) NSMutableArray *Legajos;
@property (strong, nonatomic) NSMutableArray *Nombres;
@property (strong, nonatomic) NSMutableArray *Cbus;
@property (strong, nonatomic) NSMutableArray *Sueldos;
@property (strong, nonatomic) NSMutableArray *Contribuciones;
Here is how the cells get their text: (ViewController.m)
cell.legajo.text = [Legajos objectAtIndex:indexPath.row];
cell.nombre.text = [Nombres objectAtIndex:indexPath.row];
cell.cbu.text = [Cbus objectAtIndex:indexPath.row];
cell.sueldo.text = [Sueldos objectAtIndex:indexPath.row];
cell.contribucion.text = [Contribuciones objectAtIndex:indexPath.row];
And this are the IBOutlets of the cells: (TableCells.h)
@property (strong, nonatomic) IBOutlet UILabel *legajo;
@property (strong, nonatomic) IBOutlet UITextField *nombre;
@property (strong, nonatomic) IBOutlet UITextField *cbu;
@property (strong, nonatomic) IBOutlet UITextField *sueldo;
@property (strong, nonatomic) IBOutlet UITextField *contribucion;
Sorry if its hard to understand. Thanks for any help given.