I am trying to follow Apple's recommendations on how to respond to low memory alerts in my application. The recommendations say: "Upon receipt (low memory warning), your application should free up as much memory as possible, freeing up objects that it does not need, or clear memory caches that it can recreate later."
The question is how to “free” memory using ARC?
For example, suppose I have an image in a hierarchy of views that does not appear on the screen. In didReceiveMemoryWarning, I am currently removing it from the view by calling removeFromSuperview, but I still have a pointer to the UIImage itself. Should I also try to free this memory? How? By assigning nil to a pointer?
TIA: John
source
share