didReceiveMemoryWarning using a Tab Bar

258 views Asked by At

I have a UITabBar holding 3 UIViewControllers. One being a map, the other - a table, and the third - my own custom controller. I noticed lately that my app has some issues when it comes to operating on low memory, and it's due to me not being clear about what to do when didReceiveMemoryWarning occurs.

Usually, and when with sufficient memory, all functions great. I would alloc all my controllers on the applicationDidFinishLaunchingWithOptions and all controllers work great.

But what happens when the memory is a bit low is that (for some reason) only my table is misbehaving. First, I can see that the app received a memory warning. and then only my table gets a viewDidUnload. At first I wasn't sure why my table became *completely empty*, but then I realized that my delegation methods stopped working rendering my reloadData essentially pointless.

So, I can see now that the didReceiveMemoryWarning is cascading through all my viewControllers. But viewDidUnload is called only on my table.

I want to know what is going on?

  • How do I recover from a viewDidUnload? If my view is nil, who is responsible for bringing it back? Why is it that only my table is getting the viewDidUnload? I was reading this link and that one, and some of apples documentation but found no explanation to why my view doesn't recover.

What should I be doing in this case?

0

There are 0 answers