There are few changes in code you need to do first of check for cell is nil or not
if (tableView.tag == RECO_TABLE) {
CustomCell *cell = [tableView dequeueReusableCellWithIdentifier:@"CustomCell"];
if(!cell) {
cell = [[CustomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"CustomCell"];
}
[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
NSString *roomName = [selectedRooms objectAtIndex:indexPath.row];
[cell.cellRoomName setText:roomName];
return cell;
}
And then also the text you are typing in cell's text field need to store in some other array say's "selectedRoomsPrices" and in "cellForRowAtIndexPath:" you need to check for counts and set that value as well in "cell.cellRoomPrice" like this :
if (tableView.tag == RECO_TABLE) {
CustomCell *cell = [tableView dequeueReusableCellWithIdentifier:@"CustomCell"];
if(!cell) {
cell = [[CustomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"CustomCell"];
}
[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
NSString *roomName = [selectedRooms objectAtIndex:indexPath.row];
[cell.cellRoomName setText:roomName];
NSString *roomPrice = @"";
if(selectedPrices.count > indexPath.row) {
roomPrice = [selectedRoomsPrices objectAtIndex:indexPath.row];
}
[cell.cellRoomPrice setText:roomPrice];
return cell;
}