My question is simple but though I didn’t found a precise answer on the net.
Do I have to set to nil a strong property in viewDidUnload method ?
I know weak property will be automatically set to nil but what about strong property? Do I have to do this in viewDidUnload and also in didReceiveMemoryWarning ?
Thank you a lot!
Teddy
You should set it to nil in the “companion” function to where it is set, or where you want it to go away. For instance, if you set it in
viewDidLoadyou typically set it to nil inviewDidUnload. If you set it inviewWillAppearthen set it to nil inviewWillDisappear.Set it to nil in
didReceiveMemoryWarningif it is something that you don’t really need and can be recreated when you do need it next. (such as variables automatically created in their getter’s).