我想在uitableview
中显示用户保存在Document
目录中的一些图像。我使用下面简单的代码:向tableview单元显示非常大的图像
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellIdentifier = @"uploadHistoryCellfa";
BRUploadHistoryCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (!cell) {
cell = [[BRUploadHistoryCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
}
//Some Other assignemt to UILables Here...
[cell.imagePreview setImage:[UIImage imageWithContentsOfFile:myImagePathInDocument]];
//Some other configurations here ....
return cell;
}
我的问题是:
的图像大小约为11-25 MB。我将在每个单元格中加载一个图像。这个我使用的代码可能会导致内存泄漏或者这样的事情吗?
您可以参考[此链接](http://stackoverflow.com/questions/11359383/memory-leak-on-reading-images-from-document-directory)。尝试调整图像大小 – KavyaKavita
您*必须*必须**必须***调整您的图像大小... –