I am trying to load different storyboard but am getting this error Application windows are expected to have a root view controller at the end of application launch. Can anyone help me out
- (UIStoryboard *)grabStoryboard {
UIStoryboard *storyboard;
// detect the height of our screen
int height = [UIScreen mainScreen].bounds.size.height;
if (height == 480) {
storyboard = [UIStoryboard storyboardWithName:@"iPhone_4" bundle:nil];
// NSLog(@"Device has a 3.5inch Display.");
}
if(height == 568)
{
storyboard = [UIStoryboard storyboardWithName:@"iPhone_5" bundle:nil];
// NSLog(@"Device has a 4inch Display.");
}
if(height == 667)
{
storyboard = [UIStoryboard storyboardWithName:@"iPhone_6" bundle:nil];
// NSLog(@"Device has a 4inch Display.");
}
if(height == 736)
{
storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
// NSLog(@"Device has a 4inch Display.");
}
return storyboard;
}