Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jsnuff1

macrumors 6502a
Original poster
Oct 4, 2003
726
333
NY
How can you load a NIB within an already loaded UIViewController without reloading the whole ViewController again with the new NIB?

The way i have my app set up right now is that when it launches a RootViewController loads my MainViewController by calling this method

MainViewController *viewController = [[MainViewController alloc] initWithNibName:mad:"MainView" bundle:nil];

Now I have created a MainView2.nib file which is for landscape orientations, but to load this new NIB during an autorotation call I would need to reload the whole MainViewController. I havent read anything in the API where I can simply "refresh" a viewcontroller with a new NIB, without needing to actually create a whole new instance of that controller.

If I have to reload the whole controller(which would require me to save the state of all the variables and objects in the portrait controller) then my time is better spent simply programmaticly resizing the current view so it looks fine in landscape mode.

Any insight to this?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.