I am having an issue loading the view of selected tab item.
I am using the code below in the viewDidLoad of the UIViewController at item 1 of the UITabBar.
UITabBarController *tab = self.tabBarController;
if (tab){
NSLog(@"I have a tab bar");
[self.tabBarController setSelectedIndex:1];
[self.tabBarController.view setNeedsDisplay];
self.tabBarController.selectedIndex=1;
} else {
NSLog(@"I don't have");
}
When I press Back To Tab Controller Button, it selects the tab but it doesn't open the required view. It shows the view of the tab at index 0.

Write your code in viewDidAppear: method instead of view did load. it will work..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With