I am hoping that someone else has run into this problem before.
In an Xcode Cocoa Application project I create a *.xib file with a single view, and some random sub views. I create a *ViewController.m and inherit from NSViewController
. I set the file owner in the *.xib to my controller and set the outlet view to the main view. I then create a new controller instance in the AppDelegate
's applicationDidFinishLaunching:
and add its view as a child to self.window.contentView
.
Here is the weird part... this works JUST fine in a fresh Xcode Cocoa project. The view from the *.xib is added to the main window as expected. However in the project I am currently working on I get [NSViewController loadView] loaded the "(null)" nib but no view was set
no matter what I do. At one point in time this worked in this project, it now errors every time. I have even reverted the entire repo from an old Git commit! I assume i'm seeing an Xcode bug?
EDIT More info: This seems to be connected to having the project as a child of another Xcode project. If I open the project individually (Rather than the parent project) it runs as expected.