You can also use SDWEBIMAGE. thus you can use
[cell.imageView setImageWithURL:[NSURL URLWithString:@"Your image url"]
placeholderImage:[UIImage imageNamed:@"placeholder.png"]];
Question
i have try to create a simple photo browser, and i used UICollectionView, when i try to insert them thumb images to the cell, it does't work,it has a thread, but i can't fixed it,please help me, thank you very very much. here is my code:
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"ImageCell";
ImageCell *cell = (ImageCell *)[collectionView dequeueReusableCellWithReuseIdentifier:CellIdentifier forIndexPath:indexPath];
NSArray *images = @[@"http://www.example.com/p1.jpg",@"http://www.example.com/p2.jpg",@"http://www.example.com/p3.jpg",@"http://www.example.com/p4.jpg"];
cell.imageView.image = [UIImage imageNamed:images[indexPath.row]];
return cell;
}
Solution
You can also use SDWEBIMAGE. thus you can use
[cell.imageView setImageWithURL:[NSURL URLWithString:@"Your image url"]
placeholderImage:[UIImage imageNamed:@"placeholder.png"]];