Is the viewDidUnload
& didReceiveMemoryWarning
optional if no extra logic is added to these 2 functions (i.e. save to remove the following codes)?
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
- (void)viewDidUnload {
[super viewDidUnload];
}
Yes, if no extra logic is added to these 2 functions.
But you need to inspect carefully the whether any logic is necessary?
You also need to understand when these function is run in this document by Apple
The View Controller Life Cycle
Then you decide whether you need any extra logic.
Yes.
According to the documentation, the default implementation of didReceiveMemoryWarning
"attempts to release the view controller’s view". So if you don't need anything else to happen, then you can delete the code and rely on the default.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With