Why creates duplicate rows?
my code. for test im return empty cell if(indexPath.row > 0 && indexPath.row <5) return cell;. This login should return 3 rows. 1 in top and 2 in bottom. im upload screens
int indexOne = 1;
VVMartCell* cell = [tableView dequeueReusableCellWithIdentifier:martCellIdentifier];
if(indexPath.row > 0 && indexPath.row <5) return cell;
cell.imageView1.image = nil;
cell.imageView2.image = nil;
cell.imageView3.image = nil;
[cell setDelegateController:self];
__weak VVMartCell *weakCell = cell;
//////////
VVMartModel *model1 = [self.dataArray objectAtIndex:indexOne];
[cell setModel1:model1];
if (!model1.imageView) {
model1.imageView = [[UIImageView alloc] init];
}
NSURLRequest* request = [NSURLRequest requestWithURL:[NSURL URLWithString:[model1 path_package]]];
__weak VVMartModel* weakModel1 = model1;
[cell.imageView1 setImageWithURLRequest:request
placeholderImage:nil
success:^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image) {
if(weakModel1)
{
weakModel1.imageView.image = image;
}
if (weakCell)
{
weakCell.imageView1.image = image;
[weakCell setNeedsLayout];
}
}
failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error) {
}];
Aucun commentaire:
Enregistrer un commentaire