這是正確的嗎?內存管理。 dealloc的。 iOS
- (void)dealloc {
[super dealloc];
[stageObjects release];
}
或者我應該叫
[super dealloc]
始終所有版本後,我的意思是這個函數的最後一行?
這是正確的嗎?內存管理。 dealloc的。 iOS
- (void)dealloc {
[super dealloc];
[stageObjects release];
}
或者我應該叫
[super dealloc]
始終所有版本後,我的意思是這個函數的最後一行?
您必須始終致電[super dealloc];
最後。畢竟,在超級回報的調用之後,這個對象可能總是被釋放。
[super dealloc];
應該是dealloc方法中調用的最後一行。
您還可以爲dealloc對象製作宏,因爲它不應該每次寫入方法。
RELEASE_SAFELY(object)[object release],object = nil