• 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: Pop Up Menu in NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pop Up Menu in NSTableView


  • Subject: Re: Pop Up Menu in NSTableView
  • From: Jerry Krinock <email@hidden>
  • Date: Mon, 25 Mar 2013 10:05:09 -0700

First of all, I don't want to dissuade you from considering a view-based table as Quincey suggested, if that works for you.

As Quincey said, NSPopUpButtonCell can be used in tables.  I've done it many times.

On 2013 Mar 24, at 13:47, Pascal Harris <email@hidden> wrote:

> cellPreferenceChanged is bound to the NSPopUpButtonCell in IB.

Echoing Quincey's questioning what you mean by that, you can't use Cocoa bindings on an action.  Cocoa bindings are, in my experience, good to use with tables, but the bindings for a popup button cell are not obvious:

• NSTableColumn 'selected object' must be bound to 'arranged objects' of array controller.  (This is always true, regardless of what the cell type is.)

• For dynamic menu contents, NSPopupButtonCell 'content' may be bound to an object and key path which returns an array containing objects which are assignable to the 'selected object'.

• NSPopupButtonCell 'content values' may be bound to an array giving the strings you want displayed in the table, by appending an additional key onto the key path which 'content' is bound to.  The additional key must be a method which which can be sent to the objects in the array that 'contents' is bound to, and return a string.


I'd be curious to know if you find the view-based table easier than this.  Maybe I should learn to do it that way.


_______________________________________________

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: Pop Up Menu in NSTableView
      • From: Keary Suska <email@hidden>
    • Re: Pop Up Menu in NSTableView
      • From: Pax <email@hidden>
References: 
 >Pop Up Menu in NSTableView (From: Pascal Harris <email@hidden>)

  • Prev by Date: UINavigagtionController
  • Next by Date: Re: Pop Up Menu in NSTableView
  • Previous by thread: Re: Pop Up Menu in NSTableView
  • Next by thread: Re: Pop Up Menu in NSTableView
  • Index(es):
    • Date
    • Thread