Re: validateMenuItem isn't called?
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