NSMenu in NSTableView column
NSMenu in NSTableView column
- Subject: NSMenu in NSTableView column
- From: Jonathan Taylor <email@hidden>
- Date: Tue, 12 Aug 2014 13:14:43 +0100
Hi all,
I am trying to implement a popup menu in an NSTableView column. I seem to have the bindings all set up so that the values in my NSArray are updated according to the options the user selects in the table. However, I would like to have some way of accessing the tag on the menu item that was selected for each row. I thought I could wire up an outlet to the NSMenu object attached to the table column, but when I later attempt to access the relevant menu item in the menu (in order to look up its tag), I get the following runtime error:
> -[NSMenu itemAtIndex:]: message sent to deallocated instance
I do not encounter this error if I bind to a standalone popup menu, so I don't think I'm doing anything wildly stupid here. I can imagine that within the table the popup menu objects are being dynamically allocated, so the outlet plan isn't working out.
My question then is how should I access the tags in the popup menu in order to work out which tag corresponds to the selected item in each row?
Thanks for any suggestions
Jonny
_______________________________________________
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