Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialZdeněk Zemek
4,430 PointsProblem to solve it... :(
I tried many methods how to solve it, but i am not succesfull. The last try was:
[tabBarController setSelectedIndex:2];
wrong.
Anybody could help pls?
3 Answers
Erion Vlada
13,496 PointsHope this helps
[self.tabBarController setSelectedIndex:2];
Zdeněk Zemek
4,430 Pointssolved... :-D
Gustavo Prays
2,430 PointsWhat was your solution?
Zdeněk Zemek
4,430 PointsZdeněk Zemek
4,430 PointsI hope it is clear. I have a problem with finish challenge in the course: Build a Self-Destructing Message iPhone App -> A Storyboard with a Tab Bar Controller lesson.
Task is: We just saw how to change tabs by tapping on them, but we can also do this programmatically using the selectedIndex property of UITabBarController. The tab bar controller in the example below has three tabs. Use dot-notation or the setSelectedIndex: method to set the 3rd tab as the selected tab. Note: The tabs are indexed just like arrays, meaning the 1st tab is at index 0.
But I do not know how to solve it.