Reputation: 127
* Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle (loaded)' with name 'ViewLecturer'
ViewLecturer *viewLecturer = [[ViewLecturer alloc]initWithNibName:@"ViewLecturer" bundle:nil];
[self.navigationController pushViewController:viewLecturer animated:YES];
I've check the file type and it's file.xib.
Doubled check the xib name is ViewLecturer but i still constantly get the error on the device.
Works fine on the stimulator though.
Upvotes: 4
Views: 16620
Reputation: 8102
Just found another reason for this. Normally when you add a new file to the project xcode will automatically add it to the "Copy Bundle resources" section of your target.
Sometimes, if you are collaborating with another person the project.pbxproj will get out of sync and this entry will get removed. The fix is to ensure that all the files in the Resources folder (that are required in the release) are also present in the "Copy Bundle resources" section, and if it isn't just drag it from the resources to that section.
Enjoy!
Upvotes: 2
Reputation: 26400
Make sure you use the correct file names, iOS is case sensitive, simulator is not. so if it works in simulator but not on device check the cases on the file name...
Upvotes: 6
Reputation:
ViewLecturer *viewLecturer = [[ViewLecturer alloc]
initWithNibName:@"ViewLecturer" bundle:nil];
You have to take care of two things :
Upvotes: 11