UITabBarController

AppDelegate.h @property(strong,nonatomic)UITabBarController *tbbar;

firstViewController *frst=[[firstViewController alloc]initWithNibName:@”firstViewController” bundle:nil];

frst.title=@”first”;

UINavigationController *nav=[[UINavigationController alloc]initWithRootViewController:frst];

secondViewController *secnd=[[secondViewController alloc]init]; secnd.title=@”second”;
self.tbbar=[[UITabBarController alloc]init]; self.tbbar.viewControllers=@[nav,secnd]; self.window.rootViewController=tbbar;

UITabBarController with UINavigationController

@property(strong,nonatomic)UITabBarController *tabbarctrl; onevc=[[oneViewController alloc]init];

onevc.title=@”onetab”;

UINavigationController *nav=[[UINavigationController alloc]initWithRootViewController:onevc];

twoViewController *two=[[twoViewController alloc]init]; two.title=@”twotab”;

threeViewController *three=[[threeViewController alloc]init]; three.title=@”threetab”;
tabbarctrl =[[UITabBarController alloc]init]; tabbarctrl.viewControllers=@[nav,two,three]; self.window.rootViewController=tabbarctrl;

Leave a comment