I've added a new localization for italian language in my project and after that I localized a xib file to start the translation of the project. The problem is, now when I run my project in the simulator, none of the xibs are found.
(GAIUncaughtExceptionHandler.m:41): Uncaught exception: Could not load NIB in bundle: 'NSBundle ...
I'm instantiating the file owner of this xib using initWithNibName.
I've tried both pure localization of the xib and the base localization, but none of them are working.
I'm initializing the owner like this:
[[SPConfigViewController alloc] initWithNibName:@"SPConfigViewController" bundle:nil];
EDIT:
After I created the localized version of the xib, I decided to just close XCode and open it again, and it worked...
strings files from the xib, which make localization pretty straight forward. Right click on the xib file in Xcode, and choose Get Info . Select the General tab and on the bottom click Make File Localizable . Then you will be able to add localizations by clicking Add Localization on that same tab.
In fact, the acronym "NIB" comes from "NeXTSTEP Interface Builder", and "XIB" from "Xcode Interface Builder". NIBs and XIBs are effectively the same thing: XIBs are newer and are used while you're developing, whereas NIBs are what get produced when you create a build.
I had the same experience and what a mind trip...
Process:
(Assumes a project that has chosen "Use Base Internationalization" in the Project's Info)
Localize
buttonOkay, I was optimistic that this would work, so run...
... and crash
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle < /var/mobile/Applications/_____/_____.app> (loaded)' with name '__MY NIB STRING HERE___''
Clean, Build, Run -> Crash
Option Key + Clean, Build, Run -> Crash
Option Key + Clean, Delete App, Build, Run -> Crash
Option Key + Clean, Reset Simulator, Curse, Build, Run -> Crash
Quit Xcode, Relaunch Xcode, Build, Run -> Works! WTF.
I've opened a Bug Report against the issues and would appreciate if you run into this problem that you would duplicate it so the developer tools team knows its a reoccurring issue.
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