• 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
[Fwd: NSMenuItem question]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[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

  • Follow-Ups:
    • Re: [Fwd: NSMenuItem question]
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Re: Newlines + quartz text?
  • Next by Date: Re: Scanner Question (Not NSScanner)
  • Previous by thread: Re: Scanner Question (Not NSScanner)
  • Next by thread: Re: [Fwd: NSMenuItem question]
  • Index(es):
    • Date
    • Thread