0

I am develop a sample app with multiple xib files and trying to make a navigate, first view to second unfortunately app has crashed

* Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle (loaded)' with name 'ViewController'

What is the reason? some code that I used:

#import "ViewController.h"   /*current view*/
#import "secondViewController.h"  /*view for navigate*/

-(void)navigation{
     secondViewController *desController=[[secondViewController alloc]initWithNibName:@"ViewController" bundle:nil];
     [self presentViewController:desController animated:YES completion:nil];
}
oops
  • 205
  • 2
  • 11
  • See: http://stackoverflow.com/questions/5415252/nsinternalinconsistencyexception-could-not-load-nib-in-bundle http://stackoverflow.com/questions/19025487/terminating-app-due-to-uncaught-exception-nsinternalinconsistencyexception-re – Ricky May 05 '14 at 06:24

3 Answers3

0

i think you pass wrong name in initWithNibName:@"ViewController" that cause the error.

Deep Gami
  • 508
  • 3
  • 13
0

According to crash log, problem with nib name. Instead oneViewControllerl, nib name may be oneViewController. Check with nib(xib) file & Fixed correct nib name.

Mani
  • 17,549
  • 13
  • 79
  • 100
0

Cross check if you are setting correct Nib name instead of ViewController?

secondViewController *desController=[[secondViewController alloc]initWithNibName:@"ViewController" bundle:nil];
Triyugi Narayan Mani
  • 3,039
  • 8
  • 36
  • 56
Parth
  • 634
  • 8
  • 15