CodeGeek123
CodeGeek123

Reputation: 4501

Access a tab element in tab bar controller and change value

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

Answers (1)

KIDdAe
KIDdAe

Reputation: 2722

UIViewController *viewController = [newTabBar.viewControllers objectAtIndex:0];

Upvotes: 1

Related Questions