I've followed Programmatically creating tab bar for ViewController and How can I create a tab view programmatically on iOS to try and create a tab bar programmatically in my ViewController using objective c, but my tab bar doesn't show up. Here is my code in AppDelegate.m:
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[FIRApp configure];
self.ref = [[FIRDatabase database] reference];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[self.window makeKeyAndVisible];
UITabBarController *tabBarController = [[UITabBarController alloc] init];
ViewController *viewController = [[ViewController alloc]init];
viewController.title =@"Home";
UINavigationController *nav =[[UINavigationController alloc]initWithRootViewController:viewController];
NSArray *viewControllers = [NSArray arrayWithObjects:viewController, nil];
[viewController release];
[tabBarController setViewControllers:viewControllers animated:NO];
// Put the tabBarController's view on the window.
[self.window addSubview:[tabBarController view]];
self.window.rootViewController = tabBarController;
return YES;
}
There are no errors, the tab bar just doesn't show up