Could not load nib in bundle base internationalization

半世苍凉 提交于 2019-12-09 19:41:56

问题


I have a project that I created in xcode 4.5 with a target ios of 5.0 and I used Base Internationalization. Base Internationalization moves the nib files to Base.lproj.

The project runs on my iPhone 4 running ios 6 and on my iPad 3 running ios 6. But this error shows when I try to run it on my iPad 1 running ios 5.1.1. In the Build Phase section of the target, the nib files are shown in red.

When I try to add the nib files to the Build Phases bundle resources, they add but they are still red (not found). I have tried every way I know to add the nib files to the bundle resources. How can I accomplish this?


回答1:


Base Internationalization is only supported in iOS 6. It will cause a crash in iOS 5 or below when it tries to load a Xib.

Note: Strangely, running on Simulator with iOS 5 will work. That should to be a bug.

I have detailed my experience after releasing my app with this dumb startup crash: http://samwize.com/2012/11/22/warning-do-not-use-base-internationalization-in-ios-5/




回答2:


I did not know that English (en) also must be localized. When I localized English, I was able to load the nib files into the bundle.

I'm still getting 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle (loaded)' with name 'MainViewController_iPad''

but at least now it's not because the nib files aren't in the bundle.



来源:https://stackoverflow.com/questions/12700056/could-not-load-nib-in-bundle-base-internationalization

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!