ITeye博客

关于super dealloc

chenjohney · 2011-12-14 22:43 · 移动开发 · Objective-C · Markdown

昨天的问题总算解决了,

  继承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];
}

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。