Cocoa application menu bar not clickable

前端 未结 3 1320

I\'m building a menu bar in my cocoa application with the following code in the @implementation of my custom application CustomApplication:

<         


        
3条回答
  •  别跟我提以往
    2021-02-09 13:27

    Okay, thanks to the remarks of @bhaller I was able to solve my problem.

    I actually transferred my calls to the delegate as follows.

    -(void)applicationWillFinishLaunching:(NSNotification *)aNotification
    {
      [CustomApplication sharedApplication];
      [CustomApplication setUpMenuBar];
      [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
    }
    
    -(void)applicationDidFinishLaunching:(NSNotification *)notification
    {
      [CustomApplication sharedApplication];
    
      [NSApp activateIgnoringOtherApps:YES];
    }
    

提交回复
热议问题