2
我看到這個代碼在蘋果樣品之一:爲什麼在處理子類的成員之前調用超類的viewDidUnload?
- (void)viewDidLoad {
[super viewDidLoad];
// Set the content size for the popover: there are just two rows in the table view, so set to rowHeight*2.
self.contentSizeForViewInPopover = CGSizeMake(310.0, self.tableView.rowHeight*2.0);
}
-(void) viewDidUnload {
[super viewDidUnload];
self.splitViewController = nil;
self.rootPopoverButtonItem = nil;
}
我來自一個C++的背景,所以(我想),我看慣基類的卸載方法之前處理的派生類的成員叫做。在這種情況下事先調用super viewDidUnload的原因是什麼,還是僅僅是任意的?