here is an article that explains in detail how memory warnings are handled before and after IOS6: Technical Blog from Tang Qiao:http://blog.devtang.com/blog/2013/05/18/goodbye-viewdidunload/
1, iOS4, and iOS5, when a memory warning is received, the system automatically calls the Viewdidunload method that does not currently have a VC on the interface. write the following code in Viewdidunload:
if ([self isviewloaded] &&![ [Self view] (window]) { [self setview:nil]; }
2, IOS6 began, Viewdidunload was discarded. In the development documentation, Apple recommends moving memory-collection operations to didreceivememorywarning. What else can you write down in didreceivememorywarning to reclaim memory? The best answer is that nothing is written, only the corresponding method of the parent class is called!
3. Briefly explain why IOS6 does not set the VC's view property to nil in didreceivememorywarning. UIView has a Calayer member variable that is responsible for managing the UIView drawing. Calayer is a container class for bitmap images, and Calayer creates this bitmap image class when UIView calls DrawRect. And the majority of a uiview occupies memory is this bitmap image class. Therefore, IOS6 automatically reclaims the bitmap image class when the system issues a memory warning, but does not reclaim the UIView and Calayer classes.
How to handle memory warnings before and after IOS6