Question

I am starting a new project (without ARC) targeting iOS 6. From Apple doc:

Use this method to deallocate all noncritical objects associated with your view controller. On iOS 6, you can also use this method to release references to view objects.

My question is after we deallocate "noncritical objects" within didReceiveMemoryWarning, when can we reinstate the "noncritical objects" again ?

I am asking this because since viewDidUnload will never be called in iOS6, I reckon that viewDidLoad will not be called the second time before program termination. Am I right on this?

Was it helpful?

Solution

Use lazy loading for your non-critical data. Clear up this data in didReceiveMemoryWarning. Then the data will be lazy loaded again the next time you try to access it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top