XIBs are not loaded for localization in app? - iphone

I am using localization for english and french language in my app.
When I update XIB with french it makes two XIBs and it is showing its path to fr.lproj folder also in properties of that XIB,Sampler/fr.lproj/MainWindow.xib
It being made folders en.lproj and fr.lproj in different place for different XIBs as
for Mainwindow it is in Sampler/fr.lproj/MainWindow.xib for other files it is in
Sampler/Classes/fr.lproj/About.xib
But when I run the app is shows exception
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/Library/Application Support/iPhone Simulator/4.3/Applications/3A0C67D1-F197-432A-9D9B-1086D0252E1C/Sampler.app> (loaded)' with name 'MainWindow''
what is wrong with this?

Try to follow the 6 steps given in the link which are as follows:
Making Resources Localizable in Xcode
Localizing Interface Builder files
Collecting embedded texts into resource files
Translating the resource files
Importing the translation to the iPhone application
Testing the translation in an iPhone device

Check your nib is enabled for the target you are building.

Related

Crash application in iPad but not in iPhone

Good morning,
I have an application that run well on iPhone but crash to launch in iPad and don't understand the problem.
Crash incident:Hardware Model: iPad3,3
Process: SardinianPirates1 [20569]
Path: /var/mobile/Applications/BD12D72A-B8BC-4443-B866-8B632211A467/nameofapp.app/nameofapp
Identifier: nameofapp
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2012-04-11 15:41:24.829 -0700
OS Version: iPhone OS 5.1 (9B176)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0
Application Specific Information:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </var/mobile/Applications/BD12D72A-B8BC-4443-B866-8B632211A467/nameofapp.app> (loaded)' with name 'MainWindow-iPad''
*** First throw call stack:
(0x31f9e88f 0x367f3259 0x31f9e789 0x31f9e7ab 0x32d9f437 0x32da094d 0x32cd6509 0x32b5f893 0x32b598d7 0x32b27c6b 0x32b2770f 0x32b270e3 0x3595322b 0x31f72523 0x31f724c5 0x31f71313 0x31ef44a5 0x31ef436d 0x32b58a13 0x32b55e7d 0xfbdef 0xfbda8)
This is my Xcode error log when launch the iPad simulator
2012-04-12 07:53:50.556 nameofapp[16337:10a03] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/myname/Library/Application Support/iPhone Simulator/5.1/Applications/E8655CDA-1E4F-41CB-B3C7-9A5B7BFF13A6/nameofapp.app> (loaded)' with name 'MainWindow-iPad''
*** First throw call stack:
(0x1c1a022 0x1905cd6 0x1bc2a48 0x1bc29b9 0x5bb638 0x5bceb7 0x399ce1 0x399ff8 0x39917f 0x3a8183 0x3a8c38 0x39c634 0x2312ef5 0x1bee195 0x1b52ff2 0x1b518da 0x1b50d84 0x1b50c9b 0x398c65 0x39a626 0x25a7 0x2541 0x1)
terminate called throwing an exception(lldb)
Any idea for help me?
Thank you
It's saying that it expects to find a file called MainWindow-iPad in your application bundle. Look in your Target settings under Summary, iPad Deployment Info. As Radrider33 says, this may also be requested by your app delegate.
There are three different ways you can choose to fix this:
If your app UI is precisely designed for the iPhone screen size, go to Summary, iOS Application Target and set Devices to iPhone. On the iPad, your app will run in an iPhone-shaped window, with the usual 2x button. This is the least work, but has the ugliest results.
If your iPhone UI makes good use of autosizing masks, you can set the iPad Main Interface or Main Storyboard filename to match the iPhone / iPod version. Everything view will be fitted to the larger iPad screen based on its masks.
If you want to redesign your UI for the iPad (most work, but Apple would rather you do this), create an appropriate set of files in Interface Builder. Either name the window MainWindow-iPad, or change the iPad Main Interface file to match whatever file you create.
Change your project's default window settings.
and also check your ios version of ipad
Check your project settings. Your app is trying to loan an xib with file name " MainWindow-iPad" and cannot. Be sure that everything is correct in both your app delegate as well as your project's default window settings.

"Could not load NIB in bundle" error on iPhone but not on Simulator

Up until yesterday I had a perfectly working app on my iPhone. I made a few tweaks yesterday and now the app works on my simulator but not on the iPhone. The error message I am getting is right after the "applicationDidFinishLaunching" finishes.
The error is:
'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle ....> (loaded)' with name 'RootViewController''"
The weird thing is, I don't have any xib files called RootViewController. I renamed mine a month ago to CategoryViewController and this has worked fine up until yesterday. I verified in each of my viewControllers that there is no reference to a "RootViewController".
I searched with "CTRL+shift+F" "RootViewController" and there is no file in my project that mentions this.
The tweaking I was doing had to do with the target info.plist and I only added the Application supports iTunes file sharing option. Here is my info.plist in case I messed something up:
I also had run "Clean" for the first time yesterday.
I verified that my MainWindow.xib file has all the connections it is supposed to have and compared this against the original sample project I used as a base.
I tried reverting the project back to an earlier snapshot when I am positive it worked and now that doesn't even work. It seems my iPhone bundle got corrupt. But it does the same thing even after I delete the app from my iPhone and try again.
How do I go about debugging this? I have spent 10 hours already trying to fix this and really need some help.
The Xcode templates create an Info.plist file that specifies the main nib file.
-The default nib name is "MainWindow".
-The default version of that nib file contains a Navigation controller that references a view named "RootViewController".
However, each of those can have variations for iPhone or iPad. Those files have ~iphone or ~ipad added to the end. They system will pick the variation automatically by suffix.
You could have gotten a different nib file for that reason which tried to load RootViewController.
Also, if you have a view or view controller inside your nib that references RootViewController, the OS will try to load it. (It instantiates almost everything in a nib file once it is opened.)
This was resolved by refactoring and renaming my first viewController back to RootViewController. The moral of the story is do not change the name of the RootViewController. There are built in references to it that are not easily changed. There is no real need to use a different name. Once I did this, everything worked again.

I have create lib.a file and add some classes ,resource and images.When i use this lib file with header file then it gives exception

I have create lib.a file and add some classes ,resource and images.When i use this lib file with header file then it gives "* Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle ".
How resolve this problem.
Looking at the error it seems to me as if you have view controllers in your library and you have created them with the help of interface builder.Wherever you are trying to use your library , those view controller objects are searching for those nib's to to associate with, so now the problem is you can't include nib's in a library , so
1) You either create your views programmaticaly or
2) Ship your xib's as separate files and the other user can include it in his or her project.
and also don't forget to ship images as well.hope this helps.

Could not load NIB in bundle

I don't know why I'm getting this error:
** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle < /Users/username/Library/Application Support/iPhone Simulator/4.2/Applications/D49DC6F2-7AE0-4BBD-97FB-AB9D869C48FE/Fish Quiz.app> (loaded)' with name 'Taxo2ViewController'' *
I checked all of the similar posts regarding this error but still my app generate this error. I checked all of my nib files, checked their types and they are all similar.
My app is a quiz; I have 5 questions each round. This error occurs after answering 45+ rounds of questions. I wonder why this is happen even though my app works at first. Please help me with this.
Thanks Everyone! Cheers!
Kim
Make sure to write your code correctly. Take a look at it again and see if there are mistakes.
I seen your code you provided in the links above. I found problem in your goToNext function given in first link above. What you have done is, you are having one view controller having two xib files, that is your TaxO2ViewController has two xib files. So in each of these two xib files the owner should be your TaxO2ViewController and the view property of TaxO2ViewController should be bound to both of this xib files. Probably you do not have done that.

problem with localization in objective c

I have a German program written in objective C for iPhone.
I want localize it to English, so in a file.xib I clicked on + to add localization, English appears, then I insert German.
Running the app with iphone in English goes ok, if i change language it crashes.
I've tried clean-rebuild and check folders but i get this error
* Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle (loaded)' with name 'MainWindow''
I don't know what the hell was happening, but I solved the problem by removing the original MainWindow.xib and adding a new one, which was not related to any localization.
Grrrr!