开发者

Open new NSWindowController

开发者 https://www.devze.com 2023-02-17 18:52 出处:网络
I am new to Cocoa programming. I have a main NSWindowController and would like to open a second sub NSWindowController. can\'t seem to find the co开发者_运维百科de anyway.

I am new to Cocoa programming.

I have a main NSWindowController and would like to open a second sub NSWindowController. can't seem to find the co开发者_运维百科de anyway.

Can anyone help?


not sure if this is correct but i got this working as this is new for me as well

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];

}

that seems to open up my view controller

recently i got this code from SO

   SimpleWindow *myWindow = [[SimpleWindow alloc] initWithWindowNibName:@"SimpleWindow"];

    [myWindow showWindow:nil];
    [[myWindow window] makeMainWindow];
0

精彩评论

暂无评论...
验证码 换一张
取 消