在重构代码时,认真处理一些内存未释放的问题。看到自已的目录树图标的加载,好象没有释放内存,于是,将下面的代码做修改:
if(isExpand)
{
cell.directoryAccessoryImageView.image = [UIImage imageNamed:@"TriangleSmall2.png"];
}
else
{
cell.directoryAccessoryImageView.image = [UIImage imageNamed:@"TriangleSmall.png"];
}
cell.imageView.image = [UIImage imageNamed:@"Folder.png"];
cell.directoryAccessoryImageView.image = [[UIImage imageNamed:@"TriangleSmall2.png"] autoRelease];
UIImage * img = [UIImage imageNamed:@"TriangleSmall2.png"];
cell.directoryAccessoryImageView.image = img;
img release];