title: Objective-C NSPopover statusItem not opening
body: <p>I'm having difficulty getting my NSPopover to function properly. The statusItem pops up in the status bar, and highlights on click, but the popover isn't displaying.</p>
  
  <p>Here's the structure of my code.</p>
  
  <pre><code>@property (strong, nonatomic) NSStatusItem *statusItem;
  @property (strong, nonatomic) NSEvent *popoverTransiencyMonitor;
  @property (weak, nonatomic) IBOutlet NSPopover *popover;
  @property (weak, nonatomic) IBOutlet NSView *popoverView;
  
  
  - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
      self.statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength];
      self.statusItem.highlightMode = YES;
      [self.statusItem.image setTemplate:YES];
      self.statusItem.action = @selector(itemClicked:);
  }
  
  -(void)itemClicked:(id)sender {
      [[self popover] showRelativeToRect:[sender bounds] ofView:sender preferredEdge:NSMinYEdge];
  
      if (self.popoverTransiencyMonitor == nil) {
          self.popoverTransiencyMonitor = [NSEvent addGlobalMonitorForEventsMatchingMask:(NSLeftMouseDownMask | NSRightMouseDownMask | NSKeyUpMask) handler:^(NSEvent* event) {
              [NSEvent removeMonitor:self.popoverTransiencyMonitor];
              self.popoverTransiencyMonitor = nil;
              [self.popover close];
          }];
      }
  }
  </code></pre>
  
  <p>I got help from another person on StackOverflow, Gavin, and that help is located here. <a href="https://stackoverflow.com/questions/9054244/nspopover-transiency-when-popover-is-in-status-bar">NSPopover transiency when popover is in status bar</a></p>
  
  <p>I reached out to Gavin, and he managed to help me out by sending me his xCode project and it gave me some insight. But our code matches, mine doesn't work, and his does.</p>
  
  <p>Any ideas?</p>