How much memory a view controller eats when it is loaded into the memory?
I have an application where I am planning to keep 4 view controllers in the memory as they are modal on each other and out of them, one view controller is a navigation controller (with 4-5 view controller 开发者_如何学Gopushed in stack) presented as modal.
Any suggestions?
A view controller object itself usually needs very little memory unless you use it store large objects like images or caches. What takes a lot of memory is the view that is attached to the view controller. That's why view controllers unload their views when they receive a memory warning and the view is not currently on screen.
So you shouldn't worry. Follow the memory management rules, implement viewDidUnload
correctly (release your outlets) and respond to memory warnings appropriately. The view controllers will take care of unloading and reloading their views if needed.
精彩评论