【发布时间】:2011-08-17 14:19:39
【问题描述】:
我缓存了图像,我想调整它们的大小并在表格视图中显示它们。代码如下:
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://huntify.com%@",[[hunts objectAtIndex:indexPath.row] iconURL]]];
UIImage *logo = [[UIImage alloc] initWithContentsOfFile:[[ASIDownloadCache sharedCache] pathToCachedResponseDataForURL:url]];
logo = [logo imageScaledToSize:CGSizeMake(100.0, 100.0)];
[[cell imageView] setImage:logo];
这很好,但我想知道我应该如何释放 UIImage。我怀疑在将图像属性设置为 UIImageView 后释放“徽标”是错误的,因为 imageScaledToSize 方法。我应该在调整大小并释放旧 UIImage 时分配一个新的 UIImage 吗?
【问题讨论】:
标签: iphone objective-c memory-management uitableview uiimage