0
votes

I'm currently seeing this error:

MonoTouchException: Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: Could not load NIB in bundle: 'NSBundle </Users/imac/Library/Application Support/iPhone Simulator/5.0/Applications/5D8B4B51-9FB2-4331-BFEB-B1A0AC77DF42/Tutorial.app> (loaded)' with name 'MyFirstView'

I've looked through lots of other questions like:

But I can't see that any apply here - they are mainly about file naming issues and my Nib does appear to be in the output package file with the correct name.

I'm using MonoTouch 5.2.5 and xcode 4.2, and targeting SDK5

Does anyone have any ideas about what I could try to fix this?

3
Are you sure that you nib is called MyFirstView including capitals? The iPhone's filesystem is case sensitive.rckoenes
Have you looked into that specified directory and seen the MyFirstView.nib there? Sometimes a Product => Clean in Xcode helps.ott--
I've checked in the package in ~/Library/Application Support/iPhone Simulator and the .nib seems to be there in the deployed package, including correct capitalization.Stuart
Have you tried to remove it from the simulator already? With the next run the directory 5D8B4B51-9FB2-4331-BFEB-B1A0AC77DF42 will have another name.ott--
Thanks - I think the problem is somehow in the MonoDevelop tooling. I'm really not sure what is going on... will take a break and try afresh tomorrow...Stuart

3 Answers

1
votes

I have faced the same Problem today. I refactored (rename) viewController to myCustomViewController and got this error. When I searched in my project files, I saw that I have used self.viewController = [[[MyTableViewController alloc] initWithNibName:@"viewController" bundle:nil] autorelease];

NibName was changed but in @" " it was old name. so I changed it to

self.viewController = [[[MyTableViewController alloc] initWithNibName:@"MyTableViewController" bundle:nil] autorelease];

and error was removed. Do it and hope your error will be removed. Vote up if it helps.

1
votes

The problem eventually it seems was somewhere in the extended toolchain - somewhere between MonoDevelop, xCode4 and the simulator.

Restarting everything, and resetting the simulator cleared the problem.

Later in the same chain I've seen smaller issues with "old NIB file outlets" persisting on the simulator even after I've definitely deleted them and rebuilt - so something is still going wrong somewhere... but a clean solves it each time.

0
votes

So I had a similar solution in MonoDevelop. I created an empty mono touch project. When I deleted the xib file associated with the auto created project, i ran into problems. Even though I created a new view and connected the outlet to that controller, I had to go back and recreate the xib file associated with the controller (with the same name) again, and then connect that original view and controller via the outlet