• 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
Re: Getting the view for a contextual menu
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting the view for a contextual menu


  • Subject: Re: Getting the view for a contextual menu
  • From: Ross Carter <email@hidden>
  • Date: Fri, 20 Feb 2009 14:55:24 -0500

On Feb 20, 2009, at 9:17 AM, Marshall Houskeeper wrote:

I have setup a contextual menu in interface builder that sends an action to my controller. I have several similar views that will have the same contextual menu. When I invoke the contextual menu, the controller's IBAction function gets called as expected. The sender passed to the functions is a NSMenuItem. How do I determine which view invoked the contextual menu action?

It seems to me that you need separate instances of the menu for each view, rather than sharing the same instance among all the views. You can either connect the view to the menu in IB, or set the menu items' represented object to the view.


Ross
_______________________________________________

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


References: 
 >Getting the view for a contextual menu (From: Marshall Houskeeper <email@hidden>)

  • Prev by Date: Re: Populating a new SQLite Core Data store with default data
  • Next by Date: Surprising entanglement of UI lock during fetch request in background thread (NSViewHierarchyLock/MOC locking deadlock).
  • Previous by thread: Getting the view for a contextual menu
  • Next by thread: Best method of communicating with binary java DataOutputStream on iPhone?
  • Index(es):
    • Date
    • Thread