I have a UITableView and it has bunch of UITableViewCells - These UITableViewCells have multiple UITextFields inside it.
Now every time I scroll up and down - and the UITableViewCells go out of the view - and comes back in whatever text I enter inside the UITextField disappears - What is the best way to make this work?
create an NSMutableArray
which at each position, holds an NSString
object which matches each cell.
when you config + show each cell in - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
, set the text of the UITextField
to the string in the array at position indexPath.row
.
when editing a UITextField
, insert/update the NSString
object at the current indexPath.row
position in the array
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With