I'm starting to get into Mac OS X development and I have a problem the solution to which I haven't been able to figure out for the last three hours (I've googled a long time).
Test application:
I have an application that has a MainMenu.xib
, which displays a window - so far so good. I've created another XIB and NSViewController
subclass that contains a view which I want to display within the main window. I use the following code to load the view and insert it into the main window:
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
// Insert code here to initialize your application
self.compartmentViewController = [[SelectCompartmentViewController alloc] initWithNibName:@"SelectCompartmentViewController" bundle:nil];
[self.compartmentViewController.view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[self.compartmentViewController.view setFrame:[self.contentArea bounds]];
}
compartmentViewController
is a property and self.contentArea
is a custom view on the main window - like a placeholder.
This works fine so far.
Problem
Then I decided to check out the localization feature. I've localized a couple of strings and both XIBs. At first I was a bit confused by not seeing any localized values. That was until I found out I had to clean the project - since then I've been getting the following error when running:
2013-03-19 22:48:59.763 Vocab Box[10160:303] unable to find nib named: SelectCompartmentViewController in bundle path: (null)
2013-03-19 22:48:59.764 Vocab Box[10160:303] -[NSViewController loadView] could not load the "SelectCompartmentViewController" nib.
Suggested solutions I've tried to no avail
- Cleaning the project doesn't help
- Checking the build configuration - yes, the bundle resources seem to be ok
- Yes, if I remove the localization for my subview and re-add the original XIB, things are fine again (though of course the view is not localized)
Help