我正在完成一个 iPad 应用程序,对我来说,这意味着填写dealloc
我的课程中的所有方法。
我的 nib 中有很多视图,其中大部分都包含子视图(即UIView
s、UILabel
s 等)。我应该在释放父视图之前释放子视图吗?如果父视图被释放,它的子视图是否也会被释放?
样本:
-(void)dealloc
{
[super dealloc];
[childView release]; // Do I need this if I use the next line?
[parentView release]; // Will this perform the line above?
}
两者childView
和parentView
都是我的视图控制器的属性。两者都被保留了。