in my project i have different Storyboard files to support different iPhones, i have this code in my appDelegate:
if (window.frame.size.height == 568){
UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:kMain5Name bundle:[NSBundle mainBundle]];
id rootViewController = [storyBoard instantiateInitialViewController];
[window setRootViewController:rootViewController];
} else if (window.frame.size.height == 480){
UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:kMain5Name bundle:[NSBundle mainBundle]];
id rootViewController = [storyBoard instantiateInitialViewController];
[window setRootViewController:rootViewController];
} else if (window.frame.size.height == 667){
UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:kMain6Name bundle:[NSBundle mainBundle]];
id rootViewController = [storyBoard instantiateInitialViewController];
[window setRootViewController:rootViewController];
} else if (window.frame.size.height == 736){
UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:kMain6plusName bundle:[NSBundle mainBundle]];
id rootViewController = [storyBoard instantiateInitialViewController];
[window setRootViewController:rootViewController];
}
every time i compile and run the app crashes saying it could not find storyboard file in NSBundle, i tied commenting out the above code and it worked again. is there something wrong with my code?
Here is an excerpt from UIStoryboard Class reference
Parameters
name
The name of the storyboard resource file without the filename extension. This method raises an exception if this parameter is nil.
I made the relevant part bold. In case you are not a native speaker, it means do not add the extension into the parameter. But you did exactly that in your macro.
You really should read the documentation before trying to find some more esoteric cause for any problems in code.