• 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
Re: validateMenuItem isn't called?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: validateMenuItem isn't called?


  • Subject: Re: validateMenuItem isn't called?
  • From: Gwynne <email@hidden>
  • Date: Tue, 29 Mar 2005 20:56:27 -0500

On Mar 29, 2005, at 8:46 PM, Mark Dawson wrote:
I've added a new menu action (IB + code), but it isn't being called in my validateMenuItem. I have verified that if I select the menu item, my action gets called (so the connection IS connected up correctly).

My code looks like:
- (BOOL)validateMenuItem:(NSMenuItem *)item {
    SEL action = [item action];
int i = 0;
if (action == @selector(editVertexAction))

Your problem is right here, assuming this is your actual code and not typed up in Mail. This line should be:


if (action == @selector(editVertexAction:))

You lost the colon at the end of the selector name :). This has happened to me a lot of times; it's very easy to do, since the compiler doesn't seem to complain about "no such selector".

-- Gwynne, key to the Code
Email: email@hidden
Website: http://musicimage.plasticchicken.com/
"This whole world is an asylum for the incurable."

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >validateMenuItem isn't called? (From: Mark Dawson <email@hidden>)

  • Prev by Date: NSOpenPanel and new directories?
  • Next by Date: Re: Recommended Reading
  • Previous by thread: validateMenuItem isn't called?
  • Next by thread: Re: validateMenuItem isn't called?
  • Index(es):
    • Date
    • Thread