If I have a lot of accounts in a UITableView
. The UITextFid
text which I edited in a first cell is resetting when I scroll the UITableView
. This is happening because of cell reusability. I am not setting my UITextFid
text in UITableView
at cellForRow at Indexpath. I am doing it in custom cell view due to other implementation.
Can you please guide me.
STTableViewCell *cell;
cell = [tableView dequeueReusableCellWithIdentifier:@"STTableViewCell"];
if (cell == nil)
{
cell = [[STTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"STTableViewCell"];
}
cell.accountNameTxtField.delegate = self
// Fetching the URL from Array at index of indexpath.row
OTPAuthURL *url = [self.authURLs objectAtIndex:indexPath.row];
// Sending the generated authURl and token description to custom STTableViewCell to load the data in a tableView
[(STTableViewCell *)cell setAuthURL:url withtokenDesc:nil];
return cell;