As already mentioned, you can add a file xibto configure the application to use it. Here is the version of the code, if you decide to go along this route, it is always better to know in any case
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
UIViewController *viewController1 = [[FirstViewController alloc] init];
UINavigationController *navigationController1 = [[UINavigationController alloc] initWithRootViewController:viewController1];
[viewController1 release]; viewController1 = nil;
UIViewController *viewController2 = [[SecondViewController alloc] init];
UINavigationController *navigationController2 = [[UINavigationController alloc] initWithRootViewController:viewController2];
[viewController2 release]; viewController2 = nil;
self.tabBarController = [[UITabBarController alloc] init];
NSArray *viewController = [[NSArray alloc] initWithObjects:navigationController1, navigationController2, nil];
[navigationController1 release]; navigationController1 = nil;
[navigationController2 release]; navigationController2 = nil;
self.tabBarController.viewControllers = viewControllers;
[viewControllers release]; viewControllers = nil;
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
return YES;
}
It is written in the browser, but it should work.
source
share