我试图让我的内存管理权限,并在下面的代码中,如果我包括最终版本声明(filePath的),它崩溃,我看不出为什么。我已经分配了它,为什么我不能释放它?何时发布UIImage和NSString资源
再往下,我将cellAbout返回给TableView。
有人可以解释一下吗?
UIImageView *imageView = (UIImageView *)[cellAbout viewWithTag:2];
NSString *filePath = [[NSString alloc] initWithString:self.gem.poiType];
filePath = [filePath stringByAppendingString:@".png"];
UIImage *image = [[UIImage alloc] initWithContentsOfFile: filePath];
imageView.image = image;
[image release];
[filePath release];
非常感谢,
克里斯。
一般要找到你可能有内存管理问题,尝试在Xcode中“建立与分析”选项。它报告可疑问题。 – Dolbz 2011-03-31 12:30:00