【发布时间】:2014-06-17 21:43:08
【问题描述】:
我正在cellForRowAtIndexPath 内的表格视图中从 Internet 加载一些图像。这是我的代码:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *MyIdentifier = @"ArticleCell";
ArticleCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
Article *article = [parser items][indexPath.row];
cell.title.text = article.title;
cell.newsDescription.text = article.description;
[cell.image setImageWithURL:[NSURL URLWithString:article.image]];
return cell;
}
我的问题是即使我使用SDWebImage,当我向下滚动时,我的应用程序仍然滞后。这是Instruments的一些截图:
【问题讨论】:
-
图片有多大?
-
嗯,介于 50.000 和 200.000 之间,比如说 150 KB
-
图片是什么类型的? TIFF?
-
你解决了这个问题?
-
@Nikita:我的问题是我在主线程上下载图像后对图像做了更多的工作(使图片循环),接受的答案对你有用吗?
标签: ios sdwebimage