---
title: "关于super dealloc"
author: "chenjohney"
date: "2011-12-14T22:43:18Z"
tags: ["Objective-C"]
categories: ["移动开发"]
slug: "super-dealloc"
draft: false
lastmod: "2011-12-14T22:43:18Z"
id: 1310990
url: "https://chenjohney.iteye.com/blog/1310990"
---

昨天的问题总算解决了，

  继承UITableViewCell创建自定义单元格，使用的的时候通过调用 \[NSBundle mainBundle]loadNibName: objectAtIndex:0得到单元格，但是在刷新表格的时候进入死循环了，通过追踪，发现在单元格那里调用 dealoc那里的时候出现问题了。

 

 

原来：

```
-(void)dealloc
{
     [super dealloc];
     self.image = nil;

}
```

 

正确：

 

```
-(void)dealloc
{
    self.image= nil;
    [super dealloc];
}
```

 

不出错：

 

```
-(void)dealloc
{
   [super dealloc];
   [image release];
}
```