I'm loading a view controller from a story board explicitly and have this code:
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Storyboard" bundle:nil];
UIViewController *initViewController = [storyboard instantiateViewControllerWithIdentifier:@"InitialScreen"];
But am getting an error "'Storyboard () doesn't contain a view controller with identifier 'InitialScreen'"
Yet as can be seen from the screenshot, the view controller does have that identifier. I've used this identical way of loading controllers before successfully, but no idea why its not working this time. Any ideas what the issue could be?
I've just found the problem - its an issue with the simulator, I could find absolutely nothing wrong with my code and was 100% sure it was ok, when I've been in that situation in the past I usually find the culprit is Xcode itself. So even though I'd cleaned and rebuilt multiple times I decided to try resetting the contents in the simulator - and bingo it started working. I put it down to a bug in the simulator caching content and not updating to reflect changes made in IB.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With