• 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
NSMenu in NSTableView column
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSMenu in NSTableView column
      • From: Keary Suska <email@hidden>
  • Prev by Date: Re: How to get SDK at compile time?
  • Next by Date: When to call super
  • Previous by thread: Re: How to get SDK at compile time?
  • Next by thread: Re: NSMenu in NSTableView column
  • Index(es):
    • Date
    • Thread