Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 452435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:04:20+00:00 2026-05-12T22:04:20+00:00

I have an application that sits in the status bar on the Mac. It

  • 0

I have an application that sits in the status bar on the Mac. It has a menu that lets you look at the app version, change some settings and quit the app.

I built it on Leopard and it works fine on Leopard.
On Snow Leopard, I can see the app in the status bar and clicking on it shows the menu items. But clicking items in the menu doesn’t do anything. The app isn’t hung – it’s doing stuff that it’s expected to do. The UI thread isn’t hung either – I can see the menu obviously, and and dialogs that the app causes to show on the UI thread (outside of the ones when the menu is clicked) show up fine. Compiling it on Snow Leopard targeted for 10.6 doesn’t seem to change this behavior.

So I know that the app is able to create dialogs, isn’t hung and is functioning.
I suspect this has something to do with the menu, and handling menu clicks either in my app or in Snow Leopard.

Anyone else have suggestions on what this might be or where I should look? Any suggestions on where I can place a BP to trap whether the menu item click is actually happening?

EDIT: I’ve uploaded a simple repro 10.6 XCode project. I’ll send a virtual beer your way if you can take a look and let me know if you see what’s wrong. The app is simple – create a status bar app with 1 menu item “Quit” which calls terminate on the app. The status bar app show, the menu shows but clicking does nothing. Here’s the project. It runs fine on Leopard (Clean All before you build/run) but not on Snow Leopard.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T22:04:20+00:00Added an answer on May 12, 2026 at 10:04 pm

    It sounds likely that your menu item’s action outlet isn’t “hooked up” to anything in your code. I don’t know from your description whether or not you created the menu in interface builder or are creating it programmatically, but the first thing to do would be to check there. Make sure that if you’re creating the menu programmatically, that you’ve spelled the method name correctly in the @selector() (if you’ve got warnings that say “[class] may not respond to -Foo” that’s a big tip off of a typo).

    If the connections are looking good, I’d break point the method set as your action and verify that you’re actually calling the method you think you are.

    If you’re setting the connections programmatically, breakpoint the addItemWithTitle: (or equivalent call) call and ensure that your NSMenuItem setup correctly immediately after stepping over that line.

    —EDIT—

    After looking over the posted code, there are several fundamental flaws with it, any of which could be causing the breakage under 10.6.

    1. First, you’re confusing the role of a delegate in relation to the menu. The delegate should not be your NSMenu object, your delegate should be an object that is invoked as a “call back” by the NSMenuItem to provide custom logic. You need not be extending NSMenu at all, and your MenuTestAppDelegate should only be extended from NSObject.

    2. The class of your Menu object in your MainMenu.xib file is of type MenuTest, but you don’t have a MenuTest class declared in your project. Hopefully this is merely a copy/paste error while you were setting up your test project, but you should check it out.

    3. I find it far easier to set up the NSStatusItem’s menu programmatically. Try this:


    // create the menu
    - (void)createMenu
    {   
        NSMenu* aMenu = [NSMenu new];
        [aMenu setDelegate:self];
    
        NSMenuItem* quitItem = [[NSMenuItem alloc] initWithTitle:@"quitItem"
                               action:@selector(quitSelected:) 
                               keyEquivalent:@""];
    
        [aMenu addItem:quitItem];
        [quitItem release];
    
        NSStatusItem* statusItem = [[NSStatusBar systemStatusBar]
                                   statusItemWithLength:NSVariableStatusItemLength];
    
        NSImage* itemImage = [[NSImage alloc] initWithContentsOfFile:
                             [[NSBundle mainBundle] pathForResource:@"image" ofType:@"png"]];
        NSImage* itemAlternate = [[NSImage alloc] initWithContentsOfFile:
                                 [[NSBundle mainBundle] pathForResource:@"alternate" ofType:@"png"]];
    
        [statusItem setImage:itemImage];
        [statusItem setAlternateImage:itemAlternate];
    
        [statusItem setHighlightMode:YES];
        [statusItem setMenu:aMenu];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have an application that has a launcher app that sits there with a
I'm writing a mac app that sits in the menu bar and presents the
I have created an NSStatusBar cocoa application which sits in the system status bar.
I have a WCF application that requires some app initialization code to fire when
I have an image that sits inside some folder in my MVC3 application. In
I have an application that is deployed with ClickOnce, and has an option to
I have an application that sits on IE. Police officers use it in their
I have written a Windows application, that can take in some command line arguments
I have a Silverlight Application that sits on a web page. It allows a
I have an application (server side) that sits on a port and listens for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.