In my root view controller, in my didReceiveMemoryWarning method, I look at a couple of data structures (which are stored in a global singleton called DataManager) and drop the hardest things that I have - one or two images, maybe twenty or thirty or more records data.
Now I go through and set them to zero. I also set a boolean flag so that the various view controllers that need this data can easily recognize for a reboot. Thusly:
DataManager *data = [DataManager sharedDataManager]; for (Event *event in data.eventList) { event.image = nil; event.thumbnail = nil; } for (WondrMark *mark in data.wondrMarks) { mark.image = nil; } [DataManager sharedDataManager].cleanedMemory = YES;
Today I think, though ... and I'm not really sure that everything that allocates memory is really freed up when I do this. Should I use these images instead of release and possibly hit them with new alloc and init when I need them later?
source share