Open New NSWindowController

I am new to Cocoa programming.

I have a main NSWindowController and I would like to open a second sub NSWindowController . can't seem to find the code.

Can anyone help?

+4
source share
1 answer

Not sure if this is correct, but I got this job because it is new to me too.

in the AppDelegate file I have

 - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { // Insert code here to initialize your application QuickBookingViewController * viewController = [[QuickBookingViewController alloc ] initWithNibName:@"QuickBookingViewController" bundle:nil]; SimpleWindow *myWindow = [[SimpleWindow alloc] initWithWindowNibName:@"SimpleWindow"]; [self.window addChildWindow:[myWindow window] ordered:NSWindowBelow]; } 

which seems to open my view controller

I recently got this code from SO

  SimpleWindow *myWindow = [[SimpleWindow alloc] initWithWindowNibName:@"SimpleWindow"]; [myWindow showWindow:nil]; [[myWindow window] makeMainWindow]; 
+3
source

Source: https://habr.com/ru/post/1344432/


All Articles