views:

2191

answers:

5

I'm getting this error message when I Build&Go:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] was unable to load a nib named "TestappViewController"'

I created a blank new project and then started to create a RootViewController which holds two other UIViewController's. XCode automatically created the TestappViewController, and I deleted it to start totally from scratch. MainWindow.xib shows me no TestappViewController in IB, but inside the XML structure of MainWindow.xib I find this:

<object class="IBUIViewController" id="943309135">
<string key="IBUINibName">TestappViewController</string>
<object class="IBUISimulatedStatusBarMetrics"
key="IBUISimulatedStatusBarMetrics"/> </object>

I checked all my XIB's for a reference to an TestappViewController, but there's nothing. Testapp-Info.plist points to MainWindow.xib only.

Tried to delete this part out of the XML from MainWindow.xib, but this gives some weird Xcode errors, so I re-inserted it. I assume the bug in the XIB files, but don't find anything.

Any idea at which point I could fix that?

+1  A: 

In iB in the connections inspector for the mainwindow make sure the connection to the TestappviewViewController is deleted

ennuikiller
The TestappViewController is mentioned nowhere anymore. I guess it's a bug in IB.
Thanks
+2  A: 

Finally I figured out that I had to delete and recreate the View Controller object in the MainWindow.xib. Previously I just edited the existing View Controller object and directed it to another class, which doesn't seem to work properly. Now all is fine :)

Thanks
Thanks, this is what worked for me :) You saved my day!!
Vibhor Goyal
A: 

Most likely, the file's owner of the View Controller object in the MainWindow.xib was set to TestappViewController, instead of UIView controller. What you could have done is change it back to UIViewController in the Identity Inspector (4th TAb)

Brad Smith
A: 

Go to iPhone Simulator, then click on "Reset content and settings". That did the job for me.

Armin