For some reason, in the Console I'm getting
: kCGErrorIllegalArgument: CGSUnregisterWindowWithSystemStatusBar: Invalid window
: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
with (I think) this code ...
- (void)applicationDidResignActive:(NSNotification*)aNotification
{
statusItem = [[NSStatusBar systemStatusBar]
statusItemWithLength:NSVariableStatusItemLength];
[statusItem setHighlightMode:YES];
[statusItem setEnabled:YES];
//Set menubar item's tooltip
[statusItem setToolTip:@"Nucleus"];
[statusItem setMenu:theMenu];
//Set the menubar item's title
[statusItem setTitle:[NSString stringWithString:@"N"]];
[statusItem retain];
}
- (void)applicationDidBecomeActive:(NSNotification*)aNotification
{
[[NSStatusBar systemStatusBar] removeStatusItem:statusItem];
}
I believe this is the stack trace (?) :
0x00007fff8667349b <+0000> push %rbp
0x00007fff8667349c <+0001> mov %rsp,%rbp
0x00007fff8667349f <+0004> mov %edi,%eax
0x00007fff866734a1 <+0006> leaveq
0x00007fff866734a2 <+0007> retq
0x00007fff866734a3 <+0008> nop
Why? How can I fix this?
I'm using Cocoa on Mac?