Memory managment. Dealloc. iOS
Is this correct?
- (void)dealloc {
[super dealloc];
[stageObjects release];
}
Or should I c开发者_如何学JAVAall
[super dealloc]
Always after all releases, I mean last line of this function?
You must always call [super dealloc];
last. After all, this very object might always be deallocated after the call to super returns.
[super dealloc];
should be the last line to call in dealloc method.
You can also make macro as below for dealloc objects and because of it you should not write method every time.
RELEASE_SAFELY (object) [object release], object=nil
精彩评论