Re: Getting the view for a contextual menu
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