loadView : different behavior in device v/s simulator

Discussion in 'iOS Programming' started by sujithkrishnan, Oct 14, 2008.

  1. sujithkrishnan macrumors 6502

    May 9, 2008
    HI all..

    In my iPhone App, i am having a TabBarController with some UIViewControllers pushed one over other..

    If i push some UIViewControllers, and tap the same tabBar, definitely i will come to the RootViewController.

    However this is happening in my case as well..

    But in simulator everything working fine and in device when i tap the tabBar (if i am in a topViewController after so many pushing) it is coming to the RootViewController only..but it is calling the loadView of RootViewController again...


    I pushed VC1 -> VC2 -> VC3 -> VC4 .

    If i am in VC4 and tap its tabBar i am coming to the VC1 (which is OK) but its calling the loadView: of VC1.
    (But its maintaining its instance data as same when i created that viewController)
    Why so???
  2. robbieduncan Moderator emeritus


    Jul 24, 2002
    My best guess would be that the simulator has, effectively, infinite memory (all the RAM on your Mac and it can use virtual memory), whereas the real device has heavily constrained RAM and no VM. Most likely you are using a lot of RAM and the root view controller is unloading the view to conserve RAM and only loading it back when it needs to.

Share This Page