UICachedDeviceWhiteColor を表示するメモリ リークがあります。私はどこでも UICachedDeviceWhiteColor を使用していません。それを検索すると、これは iPhone-SDK のバグであると言う人が見つかります。このブログ エントリを見つけました: http://piezoelectrics.blogspot.com/2009/02/uicacheddevicewhitecolor-leak-in-iphone.html
しかし、私は見つけることができません
#import "NSAutoreleasePool.h"
「エラー: NSAutoReleasePool.h: そのようなファイルまたはディレクトリはありません」というメッセージが表示されます。このメモリ リークの修正、またはペン先からテーブル セルを割り当てる正しい方法はありますか?
これが私が現在行っている方法です:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = nil;
cell = [tableView dequeueReusableCellWithIdentifier:@"CellNameIdentifier"];
if (cell == nil) {
[[NSBundle mainBundle] loadNibNamed:@"CellName" owner:self options:nil];
//cellName is IBOutlet to XIB's tablecell. I reference it several times in this calss
cell = cellName;
}
return cell;
}
ここに割り当てが表示されないのに、なぜメモリリークが発生するのでしょうか? これは問題になる可能性があります:
@property (nonatomic, retain) IBOutlet UITableViewCell *cellName;