Loading images from a URL into a UITableViewCell's UIImageView

前端 未结 4 2180
面向向阳花
面向向阳花 2020-12-14 13:26

I have the following code: (Note: newsImageURL is an NSArray)

NSString *imagesURL = @\"http://aud.edu/images/newsimage01.png,http:/         


        
4条回答
  •  没有蜡笔的小新
    2020-12-14 14:08

    You Can Easily load all the images with the Help of Following code ,Details Array is a Main Array

    Details Array :-  {
            "item_code" = 709;
            "item_desc" = Qweqweqwe;
            "item_name" = AQA;
            "item_photo" = "http://toshaya.com/webapp/snap&sell/api/img_items/709.png";
            "item_price" = "0.00";
            "item_till" = "20-25";
            "item_type" = Orange;
            latitude = "";
            longitude = "";
        }
    

    With the Help of Following Code Retrieve The Photo-URL into String

     NSString * result = [[DetailArray objectAtIndex:indexPath.row]objectForKey:@"item_photo"]; //componentsJoinedByString:@""];
    
     NSLog(@"%@",result);
    
    NSData *imageData = [NSData dataWithContentsOfURL:[NSURL URLWithString:result]];
    cell.icon.image = [UIImage imageWithData:imageData];
    

提交回复
热议问题