0

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?

Community
  • 1
  • 1
Stuart
  • 66,722
  • 7
  • 114
  • 165
  • Are you sure that you nib is called `MyFirstView` including capitals? The iPhone's filesystem is case sensitive. – rckoenes Feb 23 '12 at 13:39
  • Have you looked into that specified directory and seen the `MyFirstView.nib` there? Sometimes a `Product => Clean` in Xcode helps. – ott-- Feb 23 '12 at 13:48
  • 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 Feb 23 '12 at 13:52
  • 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-- Feb 23 '12 at 14:34
  • 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 Feb 23 '12 at 17:18

3 Answers3

1

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.

fibnochi
  • 1,113
  • 1
  • 9
  • 26
1

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.

Stuart
  • 66,722
  • 7
  • 114
  • 165
0

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

j will
  • 3,747
  • 11
  • 41
  • 64