Could not load NIB in bundle
I am trying to integrate Janrain Engage as custom module with Appcelerator Titanium. I have created a sample module and dragged the JREngage folder to the sample module xcodeproj as indicated in the Jainrain's documentation.
Now I give build command to this project, then execute the ./build.py
and then finally I execute the titanium run
command. It launches the application in simulator with a blank screen and immediately crashes throwing the following error.
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/abhilash/Library/Application Support/iPhone Simulator/4.2/Applications/CA167346-4091-4E16-B841-955D1D391713/test.app> (loaded)' with name 'JRProvidersController''
Why could this error be occurring?
Visit the properties of the .xib files in the file inspector,the property "Target Membership" pitch on the select box, then your xib file was linked with your target
In Targets -> Build Phases
Make sure the .xib is added to Copy Bundle Resources
, if it is not present then add .xib file.
try to find out all
XXXController = [[XXXControlloer alloc] initWithNibName:@"XXXController" bundle:nil];
in your code, and make sure that XXXController
are spelled correctly
I had the same problem (exception 'Could not load NIB in bundle: ..') after upgrading my xcode from 3.2 to 4.02. Whereas deploying of my app with Xcode 3.2 worked fine it crashes with xcode 4 raising the exception mentioned above - but only when I tried to deploy to the IOS Simulator (v.4.2). Targeting the IOS device (v.4.1) acted also with Xcode 4.
It turned out (after hours of desperately scrabbling around) that the reason was an almost "hidden" setting in the .xib-file:
Visit the properties of the .xib files in the file inspector: The property 'Location' was set to 'Relative to Group' for all .xib files. I changed it to 'Relative to project' and voila: all .xib files now are correctly loaded in IOS simulator !
I have no clue what's the reason behind that for this odd Xcode4 behavior but maybe it's worth to make an attempt ?
In my case it was very weird (use a storyboard): For some reason it changed from "Main storyboard file base name" to "Main nib file base name" in the plist.
Changing back to "Main storyboard file base name" (UIMainStoryboardFile) solved the issue