When I add a simple menu to the dock via the NSApplicationDelegate method -applicationDockMenu: and run the app from Xcode it doesn't work.
-(NSMenu*)applicationDockMenu:(NSApplication*)sender
{
NSMenu *dockMenu = [self buildDockMenu];
if (dockMenu != nil)
{
NSLog(@"Returning dock menu.");
return dockMenu;
}
else
{
NSLog(@"Not ready to build dock menu");
return nil;
}
}
When I run the app, my main app window shows up but nothing logs out in -applicationDockMenu: until I click outside my app's window (so if I click the desktop background, or a Finder window, or whatever). Then after I click outside my app's main window this logs out:
Returning dock menu.
The "Not ready to build dock menu" message does not log out.
But...when I right click on the dock icon, the menu doesn't show up.
But if I stop the app from Xcode and just run it not attached to the debugger, the dock menu does show up. But this makes the debugging/testing situation not ideal.