[Fwd: NSMenuItem question]
[Fwd: NSMenuItem question]
- Subject: [Fwd: NSMenuItem question]
- From: George Armah <email@hidden>
- Date: Mon, 13 Aug 2007 20:38:42 -0400
--- Begin Message ---
- Subject: NSMenuItem question
- From: George Armah <email@hidden>
- Date: Mon, 13 Aug 2007 20:35:07 -0400
Hello,
I previously wrote some code with this NSMenuItem declaration statement:
sendEmailMenuItem = [[NSMenuItem alloc] initWithTitle:@"Send Email..."
target:self
action:@selector(openEmailApp:)
keyEquivalent:@""];
I was using code from someone else as a template so I didn't check the
official docs for NSMenuItem's methods. The above code gave me no errors.
I'm currently trying to create a menu item using the following statement:
enableLogByContactMenuItem = [[[NSMenuItem allocWithZone:[NSMenu
menuZone]] initWithTitle:ENABLE_LOGGING
target:self
action:@selector(enableLoggingForContact:)
keyEquivalent:@""] autorelease];
and I get a "warning: no '-initWithTitle:target:action:keyEquivalent:'
method found" message after compiling. I checked the documentation and
there is no such method
for NSMenuItem.
My Question: How come the previous NSMenuItem declaration worked? (I've
seen it used in at least three different code sources and each compiled
without any
warning message.) I'll modify my code to conform to the current Apple
Docs but I'm just wondering if I missed something.
thanks,
George.
--- End Message ---
_______________________________________________
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