如何在cellForRowAtIndexPath中下载图像?

时间:2013-10-08 14:37:31

标签: ios image uitableview

如何在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 *

所以,有两个Arrays包含,不同的对象,因为indexOfFirst结束,我只是使用 *(indexPath.section- [array_favouriteClubs count]); * 作为下一个索引。

如何为这种情况下载图像?

由于

0 个答案:

没有答案