12

Trying to run my app on my device and I've got the following SIGART error when I run it:

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

I have very limited iOS experience and knowledge but I think it may be relating to the following code snippet in my ViewController.m

-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    if((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]))
    {
        log = [[NSMutableString alloc] init];
    }

    return self;
}

Does anyone know why this is happening?

N0xus
  • 2,674
  • 12
  • 65
  • 126
  • http://stackoverflow.com/questions/12722461/nsinternalinconsistencyexception-reason-could-not-load-nib-in-bundle-nsbun – iPatel Sep 26 '13 at 10:21

2 Answers2

27

To fix the problem, I did the following:

  1. Open XCode Target
  2. Go to the "Build phases" tab
  3. Click the "Copy bundle resources" section
  4. Click the add button
  5. Add the missing Nib file

Or This issue is also regarding the nib name. Check the nib name spelling, it's correct, case sensitive.

Anand Gautam
  • 2,541
  • 3
  • 34
  • 70
  • Thanks. That problem came to my project after a merge. – Gabriel.Massana Oct 11 '13 at 15:14
  • 1
    what is wrong in the above answer, why people are doing down vote again and again for the same? If you have any better answer then post it... – Anand Gautam Mar 18 '14 at 10:40
  • Thank you APG I had an issue with my nib name being mismatched to that of the main xib file and I sorted it out by updating my info.plist where my main nib file name was not listed correctly. I matched my 'Main nib file base name' to that of my main xib file name – malkoty May 27 '14 at 08:23
  • what do you do when there is no issue with the copy bundle resources? @AnandGautam – SleepsOnNewspapers Jan 18 '15 at 03:11
  • renaming the identifier name somehow fixed this for me. – Gokul Feb 20 '15 at 06:52
1

Copy your .XIB file somewhere outside the project directory. Delete the file from the project. Add it back again from the saved location.

Sebyddd
  • 4,305
  • 2
  • 39
  • 43