I have a UITableView
that is broken up into a user defined number of sections
. Within each of these sections
there are always 2 rows
. Each of these two rows
contains a UITextField
which the user is able to edit.
What I need is a way of being able to access the data in these UITextFields
at a later point. I was hoping it would be a simple problem however it's causing me a great deal of grief.
So far I have tried two approaches:
Attempt 1
I created two NSMutableArrays
in which I added the UITextField
objects to at index i (corresponding to the section
it came from). I then tried to access the values by iterating through the array. This didn't work since the UITextFields
kept getting wiped clean. Every-time I scroll down the table and the UITextField
is out of view, when I go back it's contents have been wiped clean.
Attempt 2
I tried to get hold of the number of sections
in the UITableView
(this was fine). I then wanted to iterate through each section
of the UITableView
, recording the values in the rows
of each. This is where I became unstuck since I'm not sure how to do this or if it's even possible.
I apologise if this is a naive question to ask, however I'm really struggling and would appreciate any advice.