I have a statusitem in the system menu bar that makes a popover appear when it is clicked. I would like to make the popover automatically appear when the application is first launched. I tried to add the [self clickStatusBar:self]
to the awakeFromNib method but it doesn't work. Anyone know how to accomplish this?
Here are my current methods:
- (void)awakeFromNib {
statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength];
[statusItem setTitle:@"Locating..."];
[statusItem setTarget:self];
[statusItem setAction:@selector(clickStatusBar:)];
[statusItem setHighlightMode:YES];
}
- (void)clickStatusBar:(id)sender {
[[self popover] showRelativeToRect:[sender bounds] ofView:sender preferredEdge:NSMinYEdge];
}
I tried adding applicationDidFinishLaunching:
as
- (void)applicationDidFinishLaunching:(NSNotification *)notification {
[self clickStatusBar:self];
}
but I get an error of
-[AppDelegate bounds]: unrecognized selector sent to instance