I have been working with the problem for 2 days.And i have refer some SO ques like Link 1 . What the problem is i have group table with 2 rows and array count section. When i scroll the table means the 4th section repeats the value of the 1st but it works good upto 3 section. Both the rows takes the value of 1st section rows
my code is :
static NSString *CellIdentifier = @"Cell";
cell = (CopyableTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[CopyableTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1
reuseIdentifier:CellIdentifier] autorelease];
}
cell.delegate = self;
/*UITableViewCell *cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil] autorelease];
//cell.detailTextLabel.lineBreakMode=UILineBreakModeWordWrap;
cell.detailTextLabel.numberOfLines=2;
cell.detailTextLabel.font=[UIFont systemFontOfSize:14];*/
// Configure the cell...
DLog(@"");
//cell setBackgroundColor:[UIColor colorWithRed:0.7 green:0.7 blue:0.7 alpha:0.8]]
cell.textLabel.textColor = [UIColor blackColor];//[UIColor colorWithRed:0.22 green:0.33 blue:0.53 alpha:0.8];
cell.detailTextLabel.textColor = [UIColor blackColor];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
l=indexPath.section;
switch (indexPath.row) {
case 0:
cell.textLabel.text =@"Quantity";
if (indexPath.section ==k) {
cell.detailTextLabel.text = self.qtyValue;
[cell.detailTextLabel setTag:indexPath.section];
}
break;
case 1:
cell.textLabel.text = @"Unit";
if (indexPath.section ==j) {
cell.detailTextLabel.text = [self.unitValue valueForKey:@"val"];
[cell.detailTextLabel setTag:indexPath.section];
}
break;
default:
break;
}
Can any provide solution for that