In article <168.1.3>, Alain Birtz
itemWithTitle: returns an id <NSMenuItem>, not an NSMenuItem. This
means that what is returned is an object which complies with the
NSMenuItem protocol, not an object necessarily of the NSMenuItem class.
Bottom line, I THINK (I'm sure someone will correct me if I'm wrong)
you can safely do type cast the return value to be an NSMenuItem :
menu_item = (NSMenuItem *)[[NSApp mainMenu] itemWithTitle:"Special"];
but I think the more proper way would be:
id <NSMenuItem> menu_item;
Note that the protocol contains essentially all of the functionality
that you would want; the distinction between the NSMenuItem protocol
and the implementation of the NSMenuItem class so far as I can tell is
James P. Spencer
"Badges?? We don't need no stinkin badges!"