• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Such a newbie question that I'm embarrassed to ask it :-)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Such a newbie question that I'm embarrassed to ask it :-)


  • Subject: Such a newbie question that I'm embarrassed to ask it :-)
  • From: Dale Jensen <email@hidden>
  • Date: Thu, 10 Jul 2008 21:36:59 -0500

I have the need to modify a menu item title, so I:

a) Added a tag to the menu item in IB (selected the menu item, then went to the first "tab" of the Inspector, and added a number in the "Tag" field. I tried both 99 and 1).
b) Added this code to my function:


   NSMenu *mainMenu = [NSApp mainMenu];
   NSMenuItem *menuItemToModify = [mainMenu itemWithTag: 99];

The problem is that mainMenu is never nil, menuItemToModify always is. I tried setting the "Tag" field for some standard menu items and it still returns nil.

This seems like really super basic behaviour that should be a snap to implement, so I'm guessing that I'm missing something really obvious.

Thanks for pointing out what I'm missing here!


dale

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Such a newbie question that I'm embarrassed to ask it :-)
      • From: Chris Suter <email@hidden>
  • Prev by Date: Re: JDBC Frameworks?
  • Next by Date: Re: Such a newbie question that I'm embarrassed to ask it :-)
  • Previous by thread: [Moderator] iPhone SDK is still under NDA - Do not discuss openly.
  • Next by thread: Re: Such a newbie question that I'm embarrassed to ask it :-)
  • Index(es):
    • Date
    • Thread