correct example:
- (void)dealloc {
[viewController release];
[window release];
[super dealloc];
}
wrong example:
- (void)dealloc {
[super dealloc];
[viewController release];
[window release];
}
Althoug in alsmost all other cases when overriding a method I would first call the super's method implementation, in this case apple always calls [super dealloc] in the end. Why?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…