Reputation: 615
I'm seeing the following error when I trigger my storyboard as pictured below
I'm triggering the segue via:
[self performSegueWithIdentifier:@"dayViewDetailSegue" sender:self];
Here's the error I'm getting
'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle (loaded)' with name 'UIViewController-4FQ-FK-WrG' and directory 'Main.storyboardc''
What I've tried: opening storyboard as source code, in it I can find the following
<segue destination="4FQ-FK-WrG" kind="presentation" identifier="dayViewDetailSegue" modalPresentationStyle="fullScreen" modalTransitionStyle="coverVertical" id="L8J-7U-DxM"/>
I've tried both a clean and a build directory clean.
Answers to questions by user3182143 - but still having problems
Yes Main.storyboard is in the Copy Bundle Resources. I have also tried removing it and re-adding it.
No ViewControllers are instantiated programmatically in my project.
Correctly linked to appropriate target
7. I am unable to change this value as it is greyed out. Any advice?
Not adding or changing VC's programatically. This is the first programatic thing I'm doing relating to the storyboard in the project(triggering segue)
Done.
Upvotes: 0
Views: 165
Reputation: 9589
Strictly check the following things with your project
Have you renamed your xib or storyboard file outside Xcode? If so, check everywhere you have a reference to it for inconsistencies. Also be sure you respect the uppercase / lowercase letters anywhere you reference the file since is case sensitive.
Go to Interface Builder, select your View1 ViewController > Utilities Panel > Identity Inspector
> check if the Custom Class
corresponds to your ViewController Class if you have one (.h and .m files).
Check your Info.plist
file. If you use storyboads, you should have an entry like Main storyboard file base name
and NOT Main nib file base name
. If you use nibs, then is vice-versa. Also check that the file base name corresponds with name of the actual file.
Check your target's Build Phases > Copy Bundle Resources
and make sure that your xib or storyboard file is added there.
If you instantiate your View1 ViewController programmatically and you use xib file check the nib name for typos (remember, is case-sensitive).
Also, if you currently append .xib file format to the name, remove the extension because it shouldn't be used. What I mean is this line of code: UIViewController *controller = [[UIViewController alloc] initWithNibName:@"xibFileName" bundle:nil];
Check the properties of your xib or storyboard file in the file inspector and make sure that your file is linked to your target in the Target Membership
selection panel.
Check the properties of the xib or storyboard file in the file inspector and try switching your file Location
to Relative to project
or Relative to group
. See if either way makes a difference.
If you're adding your view controller programmatically in the initWithCoder
then you should instantiate it in the viewDidLoad
method instead
If nothing from above applies to your situation, you could delete the file from Xcode (select Remove References
) and import it again in your project.
Remember to ALWAYS clean your project after making the above changes (SHIFT+COMMAND+K).
CHOICE 2
Your Class name in Storyboard was wrong.So Please delete and add again the class name in storyboard.
Upvotes: 2