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''
It happens when you rename the nib file. If you have already, create new nib(meaning copy current nib file contents to new nib), delete old nib file and it will solve your problem.
mainBundle(). loadNibNamed("SomeObject", owner: self, options: nil) self. addSubview(self. view); // adding the top level view to the view hierarchy } required init(coder aDecoder: NSCoder) { super.
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.
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 love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With