views:

815

answers:

5

I have just finished one of my apps when I got this message. I cannot for the life of me work out what is wrong.

    (gdb) continue
2010-02-26 14:05:51.443 BrainTester[2638:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] was unable to load a nib named "SplitSecondViewController"'
2010-02-26 14:05:51.452 BrainTester[2638:207] Stack: (
    861696817,
    860329709,
    861252493,
    861252395,
    835170725,
    835170141,
    835074651,
    13515,
    834774231,
    834773467,
    835014237,
    835012689,
    835011495,
    861063661,
    861449261,
    861447005,
    834770767,
    834765939,
    11025,
    10920
)
terminate called after throwing an instance of 'NSException'
Program r

eceived signal: “SIGABRT”. (gdb)

If someone can help, any help is appreciated.

A: 

You've obviously had an NSInvalidArgumentException thrown and not caught, thus calling std::terminate(), and ending the program. Not being familiar with the iPhone SDK, I can't really help more. Consult the API docs to see from whence it might have been thrown.

The error message implicates that the object UIViewController was unable to carry out message _loadViewFromNibNamed with argument SplitSecondViewController, if my reading of the Objective-C++ syntax is right.

Sorry I can't help more...

Derrick Turk
A: 

Has SplitSecondViewController.nib been added to the project and is it in a normal directory?

Also, that's an Objective-C exception, not a C++ exception.

CajunLuke
A: 

This can occur when you rename nib files but don't propagate the name change through the project. Did you rename SplitSecondViewController since you last successfully ran the app?

Or, if you deleted SplitSecondViewController at some stage, there might still be references to it elsewhere in the project. Open interface builder and go to the connections inspector for the mainwindow. If you deleted SplitSecondViewController at some stage then make sure the connection to it in connections inspector is removed.

Griffo
A: 

Look in Xcode at "Targets"->YourAppName->Copy Bundle Resources

Does exists the xib-File there ??

mario
A: 

I had the same issue and Mario's answer solved it for me. I was converting an iPhone app to work on both the phone and the iPad. For some reason it didn't put the new xib file into the Copy Bundle Resources underneath the target. Once I added it by dragging the XIB file from the Resources-iPad directory down, it fixed everything.

Thanks, Mario!

Jeremy