I have a UITableViewController and UITableViewCell. This cell contains three text fields. Each text field has a tag. The cell is created as the following.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"reuseMyCell";
cell = (TimeInserTableViewCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"TimeInsertCell" owner:self options:nil];
for (id currentObject in topLevelObjects){
if ([currentObject isKindOfClass:[TimeInserTableViewCell class]]){
cell = (TimeInserTableViewCell *) currentObject;
if ([cell.reuseIdentifier isEqualToString: CellIdentifier]) {
break;
}
}
}
}
cell.taskNameField.delegate=self;
cell.startTime.delegate=self;
cell.endTime.delegate=self;
return cell;
}
My problem is the following: when I enter text in the first text field and I scroll, the previous text field text is replacing in other cells too.
Check weather you are using reuse identifier in your custom cell IB.