problem with localization in objective c - iphone

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!

Related

iPhone exception handling crash my app

I am new on ios and i am following a tutorial to develop a calculator.
When i build my project it succeds, but on run time it crashes and throwa an exception:
`2012-09-19 10:03:51.469 AhsanCalculator[325:f803] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<ViewController 0x6d59870> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key pushOperand.'
*** First throw call stack:
My code is here if you need more detail. Tell me what you need and i will give you all the details.
Xcode = 4.3.3
5.1 iPhone simulator
Please help to solve this issue
The crash occurred for you is because, in your xib you have linked/connected some wrong objects, i mean a UITextField to a UITextView or some thing like that.
When you open Xib right clicking on the files owner object, it shows some of the IBOutlets connected with a warning icon, delete those and connect to the right/correct one.
This will clear your crash, and works fine.
As you are new to iOS development, here are some link to learn about what to when a crash appears in the project,
Its is by Raywenderlich, here it is a 2 part tutorial part 1 and part 2.

NSInternalInconsistencyException - Could not load NIB in bundle

I am getting following exception:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </var/mobile/Applications/57C8544B-05F6-445D-80A9-FAC9672F278B/MyApp.app> (loaded)' with name 'MyNibName''
I tried number of solutions suggested in stackoverflow's similar questions, but still getting this issue.
This issue is with particular xib file which loads address book.
This occurs only on iPhone and not on iPad and simulator.
I also tried deleting the existing xib file and creating a new one but didnt work out.
With few attempts of testing, I found that the file works fine for certain number of attempts and then starts giving above error only on iPhone.
Please help.
Thanks in advance.
Finally after long debugging and testing, I found the issue. The issue was NOT with NIB file, but it was with two nsmutablearrays that I had declared and was populating but not using them. I removed them and then it worked. This was bit strange for me.

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

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.

XIBs are not loaded for localization in app?

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.