I'm noticing that my view controllers aren't getting their didReceiveMemoryWarning
methods called when my application is in the background state on the iPad simulator. More specifically, I see the call to applicationDidEnterBackground
in my logs, then I hit the "Simulate Memory Warning" button, and then I notice a peculiar lack of any didReceiveMemoryWarning
calls.
However, when I bring the application back to the foreground I suddenly get the didReceiveMemoryWarning
call, as if it had been queued.
What I'm confused about here is if my application is really in the background, or if it's just flat out suspended. Is there any way to tell in the simulator?
Also, if it is not yet suspended, and really is just in the background, then I would find it silly that I'm unable to process didReceiveMemoryWarning
. Because that would then mean that only the foreground application can process memory warnings to free up space, which is of course odd given that the foreground app could be only one of possibly dozens of running apps, and it would make so much more sense if they could all free up memory.
Anyway, the main questions are: why aren't I getting didReceiveMemoryWarning
in the background state? And also, am I really suspended? And how do I tell?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…