我試圖讓我的內存管理權限,並在下面的代碼中,如果我包括最終版本聲明(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