如何在 cellForRowAtIndexPath 方法中下载图像?
我的代码如下
Cell_ClubOffer *cell = [tableFavouriteDealsAndClubs dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[Cell_ClubOffer alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
if (indexPath.section < [array_favouriteClubs count]){
//show clubs here
ClubDAO *ob = (ClubDAO*)[array_favouriteClubs objectAtIndex:indexPath.section];
NSLog(@"MY IMAGE URL IS %@", ob.logopath); //is Logo Path
//Use other ob values on Cell and return it
return cell;
}else{
//show deals here
int section = (indexPath.section-[array_favouriteClubs count]);
NSLog(@"SECTION IS %d", (indexPath.section-[array_favouriteClubs count]));
NSLog(@"COUNT IS OBJECT IS %d", [array_favouriteDeals count]);
DealsDAO *ob = (DealsDAO*)[array_favouriteDeals objectAtIndex: section];
NSLog(@"MY IMAGE URL IS %@", ob.logopath); //is Logo Path
//Use other ob values on Cell and return it
return cell;
}
现在,我有两个数组,
* array_favouriteDeals* * array_favouriteClubs*
所以,有两个数组包含,不同的对象,作为 indexOfFirst 结束,我只是使用*(indexPath.section-[array_favouriteClubs count]);*作为下一个索引。
如何下载这种场景的图像?
谢谢