I have a universal app in which I'm loading my main storyboard manually in application:didFinishLaunchingWithOptions
.
I have 2 storyboards for iPhone and iPad which have the ~iPhone
and ~iPad
suffixes. I'm loading my storyboard using:
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
self.initialViewController = [storyboard instantiateInitialViewController];
This prints Unknown class ViewController in Interface Builder file.
to the console, so apparently it's not loading the correct storyboard. However, when I use [UIStoryboard storyboardWithName:@"MainStoryboard~iPhone" bundle:nil];
it works fine, but of course will work only for iPhone.
What am I missing? How can I use the name suffixes to automatically select the correct storyboard?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…