Could not load NIB in bundle: 'NSBundle'
Solution 1
One of your NIB file is missing from project, add the required NIB file:
In Build Phases
- expand Copy Bundle Resources
- click
+
at bottom - add the required NIB file.
Clean 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.
Solution 2
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];
Solution 3
In your Build Settings, Add Architecture =>> armv6 and armv7
I just removed my error using this
Solution 4
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];
Solution 5
I Have Same Problem Just Follow Steps.
1.Copy your Project In Another Place.
2.Copy your NIB File Which Crash app.
3.Just Change Name
Ex. Old File Demo.xib Than Copy And Change Name DemoNew.xib
My Code is Below
Old Code
Demo *controller = [[Demo alloc]initWithNibName:@"Demo" bundle:nil];
I Just Change Name
Demo *controller = [[Demo alloc]initWithNibName:@"DemoNew" bundle:nil];
its working for me.
James K.
Updated on June 30, 2021Comments
-
James K. about 3 years
What is the error listed below?
2011-02-23 21:24:12.218 Success[7238:207] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/jimkillen12/Library/Application Support/iPhone Simulator/4.2/Applications/BAA5E0E7-AF12-4301-A4F8-1B9797C9E82D/Success.app> (loaded)' with name 'MainWindow-iPad''
-
James K. over 13 yearsThank you! The only thing that looks different when I open "Get Info" is the file path. The one listed does not look like the one in the NIB error.
-
James K. over 13 years'NSBundle </Users/jimkillen12/Library/Application Support/iPhone Simulator/4.2/Applications/BAA5E0E7-AF12-4301-A4F8-1B9797C9E82D/Success.app> (loaded)' with name 'MainWindow-iPad'' Instead the file path looks like this: /Users/jimkillen12/Downloads/DailySuccess/MainWindow.xib
-
minovsky almost 12 yearsthanks! everything was indeed running fine on simulator... not sure why it should...
-
Abdalrahman Shatou over 9 yearsI tried that, but it keeps appearing in red as if the file doesn't exist.
-
Umang Kothari about 8 yearsIts already added, though I am getting error. Can you please explain why?
-
DipakSonara over 6 years@Denis : You saved my day.