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 6127275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:29:09+00:00 2026-05-23T16:29:09+00:00

I have a status item and would like for several actions to happen when

  • 0

I have a status item and would like for several actions to happen when the user clicks on it. Some online help and documentation has gotten me this far.

The header file has this:

- (IBAction)updateStatusItem:(id)sender;

The class .m file has:

    [statusItem setAction:@selector(updateStatusItem:)];

I’ve tried it in both applicationDidFinishLaunching and in awakeFromNib.

And also in the m file:

-(IBAction)updateStatusItem:(id)sender{
NSLog(@"updateStatusItem worked");}

From what I can see this makes sense, but whenever I click the status item, the menu just drops down normally and the message doesn’t get logged. I thought that perhaps I had to link it somehow in IB, but as far as I can tell there is no representation of the status item in IB, it’s all done programatically. I know this can be done but it’s not working for me. Can any of you see something wrong?

Thanks for the help.

  • 1 1 Answer
  • 0 Views
  • 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-23T16:29:10+00:00Added an answer on May 23, 2026 at 4:29 pm

    For an action message to be sent, you need to have somewhere to send it. That means you must also set the target of the object, which is the object on which you want to call the action selector:

    [statusItem setAction:@selector(updateStatusItem:)];
    [statusItem setTarget:yourController];
    

    When the action is triggered, this will call the ‑updateStatusItem: method of your controller object.

    However, you cannot have a status item that uses target/action and which also has a menu. If your status item has a menu, then it will always be triggered by clicks on the status item, and the target and action of the status item are simply ignored.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a text field inside a status item and would like for it
I have already created a status item for the menu bar but I would
Some help with some T-SQL would be most appreciated. I have the following four
I would like to create a status item with a vertical slider in it,
I would like to have several Cache objects in my application and I'd like
I have some status text displayed in a BASH script, e.g.: Removed file sandwich.txt.
I have a table which has columns of data that contain status. Two example
I have the following XML document which I would like to parse into a
I'd like to build a cocoa app and would like to have it opened
I have a table like: @foreach (var item in Model) { <tr> <td> @Html.DisplayFor(modelItem

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.