I am doing this and want to open Tab bar Controller from Login Page if its first time and if already login then pass the LoginPage and open Tab Bar Controller after Spalsh>
The fact that the VC being instantiated is not a TabBarController explains the crash. The code asks storyboard for a regular vc, casts it as a UITabBarController
, then sends it a message setSelectedIndex
: that it doesn't implement because it's not a tab bar controller.
At least the first step in getting where you want to go is to add an identity in storyboard to the tab bar controller (the for which TripMapViewer is one of the tabs). Then instantiate that, and the crash should be gone.
At the design level, please see my question and answer here about how to do login and splash.