Stanley
Stanley

Reputation: 4486

didReceiveMemoryWarning in iOS 6

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?

Upvotes: 1

Views: 1521

Answers (1)

rmaddy
rmaddy

Reputation: 318784

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.

Upvotes: 6

Related Questions