correct example:
- (void)dealloc {
[viewController release];
[window release];
[super dealloc];
}
wrong example:
Its just a guideline. You can call other instructions after [super dealloc]
. however you can not access variables of the superclass anymore because they are released when you call [super dealloc]
. It is always safe to call the superclass in the last line.
Also KVO and depended (triggered) keys can produce side effects if they are depended of already released member variables.