• 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
Multiple Menus in NSPopupButtonCell / NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Multiple Menus in NSPopupButtonCell / NSTableView


  • Subject: Multiple Menus in NSPopupButtonCell / NSTableView
  • From: Greg Hoover <email@hidden>
  • Date: Sun, 21 Jan 2007 22:56:49 -0800

I have a table view with a column of nspopupbutton cells. The menu items in these popups change depending on the object at that row. I had been using a strategy outlined in several other messages where the delegate method willDisplayCell:forTableColumn: can be used to set the menu for each cell before it is displayed. I kept a copy of each of the menus used in the delegate for this purpose. This worked most of the time, but a few strange issues came up. Namely the one outlined in post: "e: Initialising NSTableColumn ??? Continued from : Setting NSPopUpButtonCell Value from NSTable" where the selected index would change without cause.

I discovered that the menus in the offending rows were not being retained correctly (as I expected), probably due to the default use of dataCell for dataCellForRow. After subclassing NSTableColumn, all problems seemed to have been resolved.

Just thought I'd share this since I couldn't find any info contrary to the willDisplayCell: solution.

Greg _______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Prev by Date: Re: Relationship between -isEqual and -hash
  • Next by Date: Re: credits.rtf problem
  • Previous by thread: Re: My Core Data experiences
  • Next by thread: Listening for multiple keypresses
  • Index(es):
    • Date
    • Thread