i created a tabBar app with ARC. So the default set up would automatically provide 2 viewControllers;
1) FirstViewController.h,FirstViewController.m;FirstViewController_iPhone.xib, FirstViewController_iPad.xib
2) SecondViewController.h, SecondViewController.m, SecondViewController_iPhone.xib, SecondViewController_iPad.xib
I wanted to create a new view controller 'ViewController3' but during the file creation process, i can only opt to create for iPad or just iPhone (checkbox 'Targeted for iPad'). I need both iPhone and iPad xibs just like the FirstViewController and SecondViewControllers created for me. So i decided to create the xib manually and continued with the file creation without xibs.
So naturally after that i went on to manually create 2 news xibs; ThirdViewController_iPhone.xib and ThirdViewController_iPad.xib
i added this line into the original AppDelegeate file:
UIViewController *viewController1, *viewController2, *viewController3;
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
viewController1 = [[FirstViewController alloc] initWithNibName:@"FirstViewController_iPhone" bundle:nil];
viewController2 = [[SecondViewController alloc] initWithNibName:@"SecondViewController_iPhone" bundle:nil];
viewController3 = [[ThirdViewController alloc] initWithNibName:@"ThirdViewController_iPhone" bundle:nil];
} else {
viewController1 = [[FirstViewController alloc] initWithNibName:@"FirstViewController_iPad" bundle:nil];
viewController2 = [[SecondViewController alloc] initWithNibName:@"SecondViewController_iPad" bundle:nil];
viewController3 = [[ThirdViewController alloc] initWithNibName:@"ThirdViewController_iPad" bundle:nil];
}
self.tabBarController = [[UITabBarController alloc] init];
self.tabBarController.viewControllers = [NSArray arrayWithObjects:viewController1, viewController2, viewController3, nil];
I then run the project and got this: Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "ThirdViewController_iPhone" nib but the view outlet was not set.'
How do i set the outlet?