UITableViewCell - 超级dealloc EXC_BAD_ACCESS

时间:2011-10-05 19:15:41

标签: objective-c uitableview

什么可能导致[超级dealloc];崩溃?

所以我在UITableViewCell中有这个

- (void)dealloc
{
    // this is ok
    [others release];

    // this crash
    [super dealloc];
}

基本上我有一个UITabViewController。当我导航到另一个选项卡,然后返回到包含UITableViewCell的此选项卡时,它将在[super dealloc]中崩溃;

这就是细胞被调用的方式。

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"DynamicSizedCell";

DynamicSizedCell *cell = (DynamicSizedCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];  
if (cell == nil) {
    cell = [[[DynamicSizedCell alloc] init] autorelease];
}

[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
return cell;

}

谢谢,
三通

0 个答案:

没有答案
相关问题