Reputation: 45
I am using TabBarController with two tabs one is InputViewController and another tab is TableViewController. In this both viewController allocated in appDelegate file and added TabBarController. Now not able to get TableViewController instance in InputViewController for passing textfield value. how to get instance TabBarController instance in first tab InputViewController
Upvotes: 1
Views: 608
Reputation: 11145
You can access a instance of item (viewController
,navigationController
) that you assigned on a tab of UITabBarController
like it -
NSArray *views = [self.tabBarController viewControllers];
Getting First Tab instance -
FirstViewController *fvc = (FirstViewController*) [views objectAtIndex:0];
You can get any tab's viewController
instance by using above code. Just change the index.
Upvotes: 3