【发布时间】:2016-01-26 11:50:42
【问题描述】:
我想在uitableview 的Document 目录中显示用户保存的一些图像。我使用下面的简单代码:
- (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。我将在每个单元格加载一张图像。我使用的这段代码是否会导致内存泄漏或类似情况?
【问题讨论】:
-
您可以参考this link。尝试调整图像大小
-
您必须 必须 必须调整图片大小...
标签: ios objective-c uitableview memory-leaks out-of-memory