Question about deprecated method viewDidUnload


#1

Hi all,

I’m in the part of Chapter 7 where it says it is important to override viewDidUnload for purposes of getting rid of any strong references to subviews of the view controller’s view. I saw in the Apple Documentation that viewDidUnload method is already deprecated in iOS 6.0+

What I want to know is where do I now write this code.

What method should it be in now that viewDidUnload is already deprecated? Or do I still have to write that line of code or is it already done for me automatically in the newer versions of iOS?


#2

It seems that under iOS7 views will no longer automatically be unloaded due to memory pressure so this method will never be called.
You can still handle a memory warning directly and choose to destroy views that are not visible yourself.