NSInternalInconsistencyException Could not load nib in bundle

随声附和 提交于 2019-11-26 22:58:21

It looks like you're trying to instantiate a nib called ThemePickerController.nib and it isn't present. Is the nib included as a project member?

In project -> Build Phases

Make sure the .xib is added to Copy Bundle Resources

Another common issue is trying to load a nib in the init methods of viewControllers. Should be in viewDidLoad.

It is easy... select the XIB file and make sure the desired target of the project is checked under the "Target Membership" section (under the "Show the file inspector" tab), and your problem is solved.

It is usually happening when you made a copy of an exists file and added to the project manually because in that case you should check the above mentioned target manually as well.

RaviM

set your button click image like this :

NSString *path1 = [[NSBundle mainBundle] pathForResource:@"btn_twelve_month" ofType:@"png"];
[btn_twelve_month setImage:[UIImage imageWithContentsOfFile:path1] forState:UIControlStateNormal];

instead of this :

[btn_twelve_month setImage:[UIImage imageNamed:@"btn_twelve_month.png"] forState:UIControlStateNormal];

It works..

You may renamed your ViewController That should be updated in AppDelegate file so navigate to AppDelegate.m and do the following.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.viewController = [[XXXXViewController alloc] initWithNibName:@"XXXXXViewController" bundle:nil];

In that XXXX rename your latest ViewController name(i.e renamed ViewControllerName).Now It will work .

There is a chance that Base Internationalization will cause a crash with the same error message, because the feature is only supported in iOS 5 and above!

However, since you can start the app and it crash only after a while, it should not be due to Base Internationalization.

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