Hi, i have custom cell with 2 buttons(the function of these buttons is just to disable the button that was pressed). When i use dequeueReusableCellWithIdentifier in this classic way:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
cell = ((MainCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]);
if (cell == nil) {
[[NSBundle mainBundle] loadNibNamed:@"MainCell" owner:self options:nil];
}
return cell;
}
the UITableView has 1 section, the problem is: on the first cell when i pressed the button to disabled it and than scroll down to show other cells, when i scroll up again the first cell is a new cell and the button is enabled. I know that reuseIdentifier is used to no recreated a cell if was already created, but in this way i lost all info of the cells that are not more visible.
Any idea?
Thanks in advance