Keep NSWindow front

后端 未结 6 1405
暗喜
暗喜 2021-01-04 01:24

I open a NSWindow from my main NSWindow.

DropHereWindowController *dropHereWindowController = [[DropHereWindowController alloc] initWithWindowNibName:@\"Drop         


        
6条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-04 01:58

    NSStatusWindowLevel works, just use it after some small delay after starting the app (or after creating the window).

    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^
    {
        self.view.window.level = NSStatusWindowLevel;
    });
    

提交回复
热议问题