【发布时间】:2013-10-16 11:12:49
【问题描述】:
我有带有图像单元格的表格。图像从互联网下载并保存在本地磁盘中。计数 = 200。Tableview 显示此图像。当滚动内容到底部时,出现消息内存警告...已用内存 250 - 300 mb O_O!!!指向不保留的图像的链接。
NSString *cellID = @"cellId";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
...
NSString* imagePath = [arrayContent objectAtIndex:indexPath.row];
UIImage* image = [[UIImage alloc] initWithContentsOfFile:imagePath];
[cell.imageView setImage:image];
为什么隐藏图片不发布?
【问题讨论】:
-
使用 Instruments 准确了解您的应用内存在什么时候增加。
-
分配:VM ImageIO_PNG_Data 281 mb O_o!!!为什么???
-
想知道为什么 ARC 没有释放 UIImage 对象。您使用的是 ARC 对吗?
-
当你运行静态分析器时,它会给你任何警告吗?
-
你需要把代码放在@autoreleasepool{}块中
标签: ios image memory-warning