【发布时间】:2014-05-16 04:18:58
【问题描述】:
我尝试创建一个简单的照片浏览器,并且我使用了 UICollectionView,当我尝试将拇指图像插入单元格时,它不起作用,它有一个线程,但我无法修复它,拜托帮帮我,非常非常感谢。这是我的代码:
- (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;
}
【问题讨论】:
标签: ios image url nsarray collectionview