Search code examples
objective-ciosxcodeipadxib

How to load a app with new nib file when app is running on main window.xib


I have got a sample app where I have delegate method and a main controller and mainwindow.xib. when my application is loaded it directly loading on mainwindow.xib. But I want to do some changes like adding buttons and other UI things. But I don't have a nib file. So I added new nib file name called Newview.xib. So how do I load this nib file?

So my requirement is how to load this nib file on launch, what all changes I have to make in appdelegate method. Present code which is running is below

-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {  

    mainController = [[MainController alloc] init];

    [window addSubview:mainController.view];
    [window makeKeyAndVisible];

    return YES;
}

Solution

  • goto MainWindow.xib, goto its attribute inspector -> view controller change the nib name to Newview. !!