1
votes

I have made a window xib and cocoa class file (nswindowcontroller) and need to show the window from xib with an button action from main window.

1
Welcome to StackOverflow. Please post the code you have so far to better help other users understand your exact issue. - Nick Peranzi

1 Answers

0
votes

In your main NSWindowController:

In the interface:

@property (nonatomic, strong) CustomWindowController *windowController;

In the implementation:

- (IBAction)didPressOpenWindowButton:(id)sender {
    CustomWindowController *wc = [[CustomWindowController alloc] init];
    [wc showWindow:nil];
    [wc.window makeKeyAndOrderFront:nil];
    _windowController = wc;
}

Connect your IBAction to your NSButton in the main window.