5
votes

When I test the app on the simulator, I get the following:

Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: Could not load NIB in bundle: 'NSBundle <...> (loaded)' with name '...Controller'

But when I use the actual device everything is fine.

Any ideas?

8
are you using it on mac or windows? - preetam
mac. Actually I just reloaded the project, and now I get the same exception on the actual device. - nightsnaker
are you using xcode? for screen design ? problem seems like your viewcontroller identifier is not matching with the one you are using in code - preetam
Yes, I am using Xcode and the problem seems to really have appeared after modifying smth there. Where do I find the identifiers to unify them? - nightsnaker

8 Answers

3
votes
  1. Deleted all the controls in the xib, made my UI fully generated in code. Did not help.
  2. Deleted both .cs and .xib files, created a new iphone controller, pasted the code. Still did not help in spite of the new empty xib!
  3. Renamed my controller class name. Reinstalled the app in simulator. Resolved! PS. I tried reinstalling the app before step 1. And that did not help. So I do not know what exactly resolved the problem.
2
votes

In your Info.ptlist , check if your "Main Interface" is correct

1
votes

Using Xamarin Studio on the Mac, I got this error. Also my iOS emulator was acting kind of strange too...I first cleared the programs and settings from the emulator, but that didn't help. So then I just rebooted the Mac. This solved the problem.

1
votes

I was having the same problem - what fixed it for me was to make sure that under Properties, the .xib file had a build action of 'InterfaceDefinition' (instead of 'None').

0
votes

Apparently this is a bug in Xamarin Studios, I contacted support and they said that they know about it and its going to be fixed in the next release.

They sent me this link https://files.xamarin.com/~jeff/XamarinStudio-4.2.4.243.dmg which didnt work for me. i tried everything , reinstalling simulator and even reinstalled xcode. But what worked for me was deleting and reinstalling Xamarin Studios. then it all worked again. still not sure whats going. Hope this helps others with same issue cause i know its a big issue on the Xamarin Forums.

0
votes

sebastian says;

If you want to use the older Xamarin.iOS (7.0.7.2) then you need the older Xcode (5.0.2).

0
votes

I had the same problem. Changing the Storyboard Id for the ViewController specified in error to something else in Xamarin's iOS designer solved the problem for me.

0
votes

Deleted bin and obj folders and restarted Rider, working for me now.