MainMenu.xib generally has an instance of AppDelegate. First declare an IBOutlet of MainWindowController in the header file of the automatically generated AppDelegate class, then go back to MainMenu.xib and connect the instance of MainWindowController (blue cube) to the IBOutlet just declared in AppDelegate.
Then, the rest of the code needs to access the instantiated MainWindowController, which can be done through the IBOutlet property or ivar of AppDelegate. Of course, access will not be effective until after -awakeFromNib.
NSViewController* viewController = [[NSViewController alloc] initWithNibName:@"SomeNibName" bundle:nil];
MainMenu.xib generally has an instance of AppDelegate. First declare an IBOutlet of MainWindowController in the header file of the automatically generated AppDelegate class, then go back to MainMenu.xib and connect the instance of MainWindowController (blue cube) to the IBOutlet just declared in AppDelegate.
Then, the rest of the code needs to access the instantiated MainWindowController, which can be done through the IBOutlet property or ivar of AppDelegate. Of course, access will not be effective until after -awakeFromNib.