in my application i have to use tab bar.but the problem is my first view is homeviewcontroller and it contain no tab bar or tab bar controller.now when click on login it goes to first view controller and it contain tab bar.
i am using story board and when i drag drop tab bar item into navigation controller tab bar item image is not showing i am new to storyboard. when i am running my app it goes to first view controller but tabbar item not change.
Here is my code:
in homeviewcontroller.m
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([[segue identifier] isEqualToString:@"sign"])
{
[((AppDelegate *)[[UIApplication sharedApplication]delegate]) configure];
NSLog(@"ok");
}
}
in appdelegate.m
-(void)configure
{
NSLog(@"Call Tabbarcontroller");
_tabBarController = (UITabBarController *)self.window.rootViewController;
UIViewController* vc = [_tabBarController.viewControllers objectAtIndex: 0];
vc.tabBarItem = [[UITabBarItem alloc] initWithTitle: @"title" image:[UIImage imageNamed:@"home.png"] tag:0];
}