Juan Munhoes Junior
Juan Munhoes Junior

Reputation: 895

UITabbarController deallocating my viewcontrollers

I having some problem: Im using UITabBarController and 3 tabs, witch one is camera. When i open camera, sometimes give Received Memory warning. And when it happens, all my views are deallocated except the camera. Is it normal? is there some way to control to not happen it? Gratz.

EDIT: im testing with a 3gs model

Upvotes: 0

Views: 332

Answers (1)

Seamus Campbell
Seamus Campbell

Reputation: 17916

I presume you mean your view controllers' views are deallocated, rather than the view controllers themselves.

This is normal behavior. UIViewController is built on the assumption that under low-memory conditions, the view can be thrown away if the view controller's view is not on-screen. You can save your state in -viewWillUnload so that you can rebuild it when the view controller's view comes back on screen and is recreated.

This automatic-unloading behavior is removed in iOS 6.

Upvotes: 2

Related Questions