if i have a View-based project like this
dummyAppDelegate.h
dummyAppDelegate.m
dummyViewController.h
dummyViewController.m
dummyViewController.xib
now i want to add a view called "notdummyViewController" and make it load at start to replace dummyViewController. how could i do this?
In your _info.plist, you'll have a "Main nib file base name", most likely MainWindow. Open up this xib and change the class of the View Controller to notdummyViewController.
You have this code in your appDelegate applicationnDidFinishLaunching
[window addSubview:viewController];
[window makeKeyAndVisible];
In ur dummyAppDelegate.h the viewCOOntroller is of type dummyViewController
So now what you can do is change the viewController object in .h to notDummyViewController type
And one more step remaining is in MainWindow.xib change the viewcontroller type to notdummyViewController and assign it to File Owners viewController property!
And now you are ready to launch the application!
i figured out but not sure it is the appropriate approach
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after app launch.
notdummy = [[notdummyViewController alloc]init];
[self.window addSubview:notdummy.view];
[self.window makeKeyAndVisible];
return YES;
}