我正在cellForRowAtIndexPath
中的表格视图中从互联网加载一些图片。以下是我的代码:
- (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
的一些截图: