views:

106

answers:

1

Hi,

I have very unique problem. My app has UINavigationCnotroller with a set of UIViewController's. Most of the time everything goes fine but at some point, when I press Back button, the UIViewController to which I return suddenly reloads. i.e. the loadView called second time and the interface becomes squashed.. Prior to this I had UITabbarController in which I saw the same issue (when switching between tabs). It looks like UINavigationController/UITabBarController just reset some of UIViewController at some point. Also, this issue is visible only on device. Any ideas??

Many thanks in advance!!!

+1  A: 

The reason -loadView is getting called again is that the view, while offscreen, got unloaded: your application got a memory warning and the view-controller system tried to release whatever views weren't currently visible. Your interface becoming “squashed” suggests that you're not unloading it properly; make sure that your -loadView method can create the entire UI from scratch, and that your -didReceiveMemoryWarning—whose default implementation releases the view if it has no superview, which is what's happening here—is letting go of any parts of the view you're holding on to.

Noah Witherspoon
Thank you very much!
Dmitry