I have iphone.storyboard and ipad.storyboard.
iPhone storyboard has UITabBarController as root view controller . Now i have to start with iPad storyboard. I need a split view controller here and apple says it has to be the root view. now i am adding a split view controller and then UITabBarController to iPad storyboard. My app is crashing due to the code -
UITabBarController *tabBarController =
(UITabBarController *)self.window.rootViewController;
UITabBarItem *tabBarItem0 = [tabBarController.tabBar.items objectAtIndex:0];
UITabBarItem *tabBarItem1 = [tabBarController.tabBar.items objectAtIndex:1];
UITabBarItem *tabBarItem2 = [tabBarController.tabBar.items objectAtIndex:2];
UITabBarItem *tabBarItem3 = [tabBarController.tabBar.items objectAtIndex:3];
When i add a simply UITabBarController with four tabs in iPad story board it works fine.
Shall i add any check for the device.. how to solve this issue as i have to use split view controller?
pls help