I'm getting crazy on this.
I've got a TabBarController with threw viewController and it's working ok in my app when I push the selection on the items.
开发者_如何转开发When I try to call self.tabBarController.selectedViewController = [self.tabBarController.viewControllers objectAtIndex:2]; (index 2 exists and the problem is with the index 1 too), I see the tabBarItem at position 2 selected (I mean the button) but the view will not appear (remaining at position 0 of the array item). I see that the viewController selected works in my debugger console but the view just doesn't appear.
Why it doesn't work? I've used it in previous apps and apparently there's nothing different.
Thanx for any suggestion you can provide.
Fabrizio
It was a time problem, I was calling the setSelectedViewController too early and it couldn't switch.
Fixed using this:
[self performSelector:@selector(yourMethod) withObject:nil afterDelay:0.1];
Fabrizio
精彩评论