Reputation: 4501
How do you access an element in a tab bar controller and change its value? For instance i want to access a particular view controller in a tab bar controller and change a property in the view controller. Been stuck with this for a while. I have called tab bar init with nib name and initliased the tab bar. Now i need to know how to access one view in it. I tried
UITabBarController *newTabBar = [[UITabBarController alloc]initWithNibName:@"PlaceTabBarControllers" bundle:nil];
[newTabBar.selectedViewController setView:listViewController.view];
but this doesnt work.
Upvotes: 0
Views: 619
Reputation: 2722
UIViewController *viewController = [newTabBar.viewControllers objectAtIndex:0];
Upvotes: 1