I am using custom table view cell and my table view showing repeated data after index 5 I don't know why it is done When in ipad it shows after index 8 repeated data it may be indexing problem but couldn't find it below is the code - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"item";
ItemCell *cell = (ItemCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[ItemCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
NSLog(@"indexpath.row is %d",indexPath.row);
NSString *stre = [grouporphoto objectAtIndex:indexPath.row];
if([stre isEqualToString:@"Group"]){
folderimage = YES;
NSLog(@"here is folder");
cell.item = [items objectAtIndex:indexPath.row];
}
else if([stre isEqualToString:@"Photo"]){
folderimage = NO;
NSLog(@"here is Photo");
cell.item = [items objectAtIndex:indexPath.row];
}
return cell;
}
Please help Thanks in advance
cell.itemwould never get updated and that would explain why you get duplicated data (reused cells). Put NSLog outside the ifs and see if it prints. - lawicko