Hi guys,
I'm hacking again. :-)
And as usual, I'm running into issues I don't understand. I'm tying to
modify the standard application menu (and having great success with
that). But, the action of an NSMenuItem is always returned as
"undefined selector". This happens wether or not I explicitly set the
action to a Selector created by Foundation.selector or just try to get
the default one. If I replace the target (with a non-conforming
object), I'll get an exception that will tell me the correct name of
the selector. Is there a bug in Rococoa here?
The NSMenuItem action method is defined as
- (SEL)action
and setAction as
- (void)setAction:(SEL)aSelector
My definitions are:
pubilc abstract Selector action();
public abstract void setAction(Selector s);
The problem is now that for example
item.setAction(item.action());
will make the application crash if that menu item is selected, while
it should (effectively) be a no-op, making the menu item do exactly
the same as before...
Ideas?
Thanks,