How to I connect Button Action to Tabbar Viewcontrollers
ios, ipad, iphone, objective-c
Solution
First of all, take `UINavigationController` and `UITabbarController` in your `MainWindow.xib` and bind `IBOutlet` to respective fields.. ans set `LoginViewController` as rootViewController of your `UINavigationController`..
Then in `didFinishLaunchingWithOptions` method write this..
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[self.window setRootViewController:navController];
[self.window makeKeyAndVisible];
return YES;
}
Now create other method in `AppDelegate.m` like this..
-(void)loadApplication
{
[navController pushViewController:tabbarController animated:NO];
}
On your Login button action.. call this method as follows..
-(IBAction)btnLoginTapped:(id)sender
{
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication]delegate];
[appDelegate loadApplication];
}
Problem
I am new to iPhone development. I am developing a `TabBarViewcontroller` App (iPhone and iPad) and in that I've created one `LoginViewController` and a Button Action. My expectation is after clicking that Button, the control will move from `LoginViewController` to `TabBarViewController`. In this `TabBarViewcontroller` I have 5 Tabbar (items) ViewControllers. Is it possible? If you can, please share your ideas.