开发者

UITableViewCell - super dealloc EXC_BAD_ACCESS

开发者 https://www.devze.com 2023-04-11 14:11 出处:网络
What could cause a [super dealloc]; to crash? So I have this in my UITableViewCell - (void)dealloc { // this is ok

What could cause a [super dealloc]; to crash?

So I have this in my UITableViewCell

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

    // this crash
    [super dealloc];
}

Basically I have a UITabViewController. When I navigate to another tab, and come back to this tab that contains the UITableViewCell, it will crash at [super dealloc];

This is how the cell is getting called.

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

DynamicSizedCell *cell = (DynamicSizedCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];  
if (cell == n开发者_开发知识库il) {
    cell = [[[DynamicSizedCell alloc] init] autorelease];
}

[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
return cell;

}

Thanks,

Tee

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号