我有一台带两个客户UIViews articalBottomPanel的UIView
每个自定义视图都在单个类中声明
first view articalBottomPanel委派将设置为self
第二个视图也将采用self.artical、self
如下所示:
[self.articalBottomPanel setDelegate:self];
[self.articalBottomPanel.btnCommment addTarget:self action:@selector(commentBtnPressed:) forControlEvents:UIControlEventTouchUpInside];
[self.movingSharePanel setArtical:self.artical];
[self.movingSharePanel setParentView:self]; 我的dealloc是
- (void)dealloc
{
NSLog(@"ArticalViewController : dealloc");
[movingSharePanel_ release];
[articalBottomPanel_ release];
[super dealloc];
}问题是:当我弹出视图时,没有调用自己的dealloc ?!
问题是:在弹出这个视图本身之前,它是否想要做比delloc的发布更多的发布?!
发布于 2011-10-10 16:29:18
你是否委托@property(保留)?如果是,那么让它赋值。如果没有,请确保您的ViewController已发布。检查在按下它之后,您是否释放它。
发布于 2011-10-10 23:22:37
retainCount是没用的。别叫它。
具体地说,对象的绝对保留计数是一个无关紧要的实现细节,通常应该忽略它(只有当您还拥有每个保留/释放的准确清单时,它才有用,但如果有,保留计数也没有用)。
See this answer提供了一个精彩的解释,解释了如何准确地追踪到谁/什么仍然保留着这个对象。
https://stackoverflow.com/questions/7709859
复制相似问题