Ajouter un contrôleur de barre d'onglets par programme au flux d'applications actuel

Je veux ajouter un onglet de la Barre de Contrôleur pour mon Application actuelle des Flux. Actuellement, j'ai une page avec un bouton en cliquant sur s'ouvre dans une nouvelle viewcontroller avec une vue web où l'utilisateur se connecte et après la connexion, j'ai envie de l'emmener à son domicile en Page de la barre de navigation a son nom et un bouton de déconnexion dans le droit. La page d'accueil devrait également avoir une barre d'onglet avec 3 onglets différents.
Je suis en mesure de charger la page d'accueil de vue de la webview et obtenir la barre de navigation. Mais je suis incapable d'ajouter la tabBar. Je suis confus quant à l'endroit où ajouter le code pour l'ajout de TabBar. Je suis en utilisant le code ci-dessous pour ajouter un onglet de la barre -

UITabBarController *tabBar = [[UITabBarController alloc] init];
HomeViewController *home = [[PPHomeViewController alloc] initWithUserName:[self.userInfo objectForKey:@"name"] Email:[self.userInfo objectForKey:@"email"] Phone:[self.userInfo objectForKey:@"phone_number"]];
home.tabBarItem = [[UITabBarItem alloc]initWithTabBarSystemItem:UITabBarSystemItemFavorites tag:1];
UINavigationController *homeNavController = [[UINavigationController alloc]initWithRootViewController:home];
RequestViewController *req = [[RequestMoneyViewController alloc]init];
req.tabBarItem = [[UITabBarItem alloc]initWithTabBarSystemItem:UITabBarSystemItemFavorites tag:2];
UINavigationController *reqNavController = [[UINavigationController alloc]initWithRootViewController:req];
UIViewController *thirdViewController = [[UIViewController alloc]init];
thirdViewController.tabBarItem = [[UITabBarItem alloc]initWithTabBarSystemItem:UITabBarSystemItemFavorites tag:3];
UINavigationController *thirdNavController = [[UINavigationController alloc]initWithRootViewController:thirdViewController];
UIViewController *fourthViewController = [[UIViewController alloc]init];
thirdViewController.tabBarItem = [[UITabBarItem alloc]initWithTabBarSystemItem:UITabBarSystemItemFavorites tag:3];
UINavigationController *fourthNavController = [[UINavigationController alloc]initWithRootViewController:fourthViewController];
tabBar.viewControllers = [[NSArray alloc] initWithObjects:homeNavController, reqNavController, thirdNavController, fourthNavController, nil];
tabBar.delegate=self;
tabBar.selectedIndex=0;
UIImageView *homeImg=[[UIImageView alloc]initWithFrame:CGRectMake(0, 432, 80, 49)];
homeImg.tag=11;
homeImg.image=[UIImage imageNamed:@"footer"];
UIImageView *reqImg=[[UIImageView alloc]initWithFrame:CGRectMake(81, 432,80, 49)];
reqImg.tag=12;
reqImg.image=[UIImage imageNamed:@"footer"];
UIImageView *sendImg=[[UIImageView alloc]initWithFrame:CGRectMake(162, 432,80, 49)];
sendImg.tag=13;
sendImg.image=[UIImage imageNamed:@"footer"];
UIImageView *localImg=[[UIImageView alloc]initWithFrame:CGRectMake(243, 432, 80, 49)];
localImg.tag=14;
localImg.image=[UIImage imageNamed:@"footer"];
[tabBar.view addSubview:homeImg];
[tabBar.view addSubview:reqImg];
[tabBar.view addSubview:sendImg];
[tabBar.view addSubview:localImg];
[[[UIApplication sharedApplication]keyWindow]addSubview:tabBar.view];

Actuellement, j'ai mis le code ci-dessus dans le viewDidLoad d'un ViewController TabViewController qui s'étend UITabBarController. Dans mon webView contrôleur, j'ai mis le code suivant -

TabViewController *tab=[[TabViewController alloc] init];
tab.userInfo=userInfo;
[self presentViewController:tab animated:YES completion:nil];

Mais l'application se bloque dès que je clique sur un onglet autre que celui déjà ouvert.
S'Il Vous Plaît Aider.

source d'informationauteur Akshay Goel