How to add UINavigationController to UITabbarController Programatically?


Today I am going to Explain you How to Add UINavigation Controller to UITabbarController.

  • When you add UIViewController to UIWindow Your Application become ViewControllerBase(SingleView) Application.
  • When you add UIViewController to UINavigationController your application become NavigationBased(Master-Detail) Application.
  • When you add UIViewController/UINavigationController to your UITabbarController Your application become Tabbased Application.

so here we are using the same concept that add your Navigation Controller to UITabbarController so you will get Push/Pop effect in UITabbar Controller.

//Initialize tabbar Controller and All Navigation Controllers are added into Tabbar Controller
self.tabbar = [[UITabBarController alloc] init];
NSArray *arrNVControllers = [NSArray arrayWithObjects:nav1,nav2,nav3,nav4, nil];

self.tabbar.viewControllers = arrNVControllers;

Download the sample code from Here


Day-14 for iOS development

Click here for Lecture 14 which includes

1.UIImagePickerController( Getting still photos or video from the user either from camera or photo library)

2. MPMovie[View]PlayerController   ( How to play videos )

3. ALAssetsLibrary   (How to store images or videos in the user’s photo album)

4. Sounds  ( How to play simple sounds and record simple audio snippets)