What is the error listed below?
2011-02-23 21:24:12.218 Success[7238:207] * Terminating app due to uncaught exception \'NSInternalInconsisten
0
For example If your using a UIViewController class name as TextPicker Then u need to use like Bellow Code
let bundle = Bundle(for: TextPicker.self)
super.init(nibName: "TextPicker" , bundle: bundle)
If You are using TableView with Xib in other project as Framework
tableView.register(UINib.init(nibName: "TextPickerCell", bundle: bundle), forCellReuseIdentifier: "TextPickerCell")
let bundle = Bundle(for: TextPicker.self)
Probably, you have named your NIB in a call by lowercase letters. The simulator works fine in this case, but an iPhone device will return an error during runtime.
For example,
DetailViewController *detailViewController = [[DetailViewController alloc]
initWithNibName:@"detailViewController" bundle:nil];
will fail. You need to change to:
DetailViewController *detailViewController = [[DetailViewController alloc]
initWithNibName:@"DetailViewController" bundle:nil];
If you are trying to load a collectionView cell in a collection view which is picked up from a nib then you might be seeing the error" 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle " When you are loading a collection view from a nib file, you do not have the option to declare a collection view cell on the nib unlike story board. The correct way is to create a new custom cell , with a new nib and then load it on to the collection view. Note : don't forget to register the nib of the new custom collection cell.
Just check that file MainWindow.xib
exist in your project. If not, just add the new interface file with name MainWindow.xib
.
One of your NIB file is missing from project, add the required NIB file:
In Build Phases
+
at bottomClean your build by Shift+Cmd+K
, then run.
P.S. Also make sure to use exact spelling of NIB file while calling initWithNibName:@"ViewNameController"
Probably, you have named your NIB in a call by lowercase letters or you may have also included extension .xib which is not required.
I have got the same problem, but it was because i wrote the extension .xib and it is not neccessary
token_view = [[GetToken alloc] initWithNibName:@"GetToken_iPad.xib" bundle:nil];
instead of
token_view = [[GetToken alloc] initWithNibName:@"GetToken_iPad" bundle:nil];