The two answers are great! And they helped. But there are some observations that I find interesting to make. The @Douglasferreira solution, make a new instance of objects already created by Storyboard. And since I have a few screens before loading the Tabbarcontroller, then I wouldn’t act on the correct object.
The solution presented by @iTSangar did not work because the object did not respond to the direct pointing in the variable selectedIndex
.
The solution I created was the following:
I created a controller class and connected it with Tabbarcontroller in Storyboar, and in the method
viewDidLoad
, as recommended by @iTSangar, I did this:
[self setSelectedIndex:2];
And it worked!!