私は1000要素のUITableViewを持っています。最初に読み込む前にインストゥルメントは2.20MBのバイトがまだ生きていることを示します。充電後は4.82MBと表示されます。メモリを解放して前の状態に戻ると、4.71MBが表示されます。しかし、同じテーブルをロードすると、Instrumentsは再び4.82MBを表示します。 UITableViewの構造はキャッシュに保存されていますか?はいの場合、このメモリを解放する方法はありますか?キャッシュされた要素UITableView
私のテーブルの構築:もちろん
(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *MyIdentifier = @"SearchResult";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyIdentifier] autorelease];
}
if(!isSomeStateSearching) cell.textLabel.text = [[[contentSomeState objectAtIndex:indexPath.section] objectForKey:@"rowValues"] objectAtIndex:indexPath.row];
else
{
cell.textLabel.text = [searchedAllContent objectAtIndex:indexPath.row];
}
UIView *v = [[[UIView alloc] init] autorelease];
v.backgroundColor = [UIColor colorWithRed:188/255.0 green:57/255.0 blue:25/255.0 alpha:1.0];
cell.selectedBackgroundView = v;
UIImageView *arrow = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"seta_navegacao"]] autorelease];
cell.accessoryView = arrow;
return cell;
}
はい、質問に追加します。 – flopes