• 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
Binding to title of NSButtonCell in a table view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Binding to title of NSButtonCell in a table view


  • Subject: Binding to title of NSButtonCell in a table view
  • From: Gideon King <email@hidden>
  • Date: Sun, 18 Jul 2010 14:45:46 +1000

Hi, I'm having trouble doing something I would have thought would be very simple.

I have some columns in an NSTableView where I need to display NSButtonCells, and I need the titles to be dynamic as the underlying data (in coredata) changes. I can bind the value to an NSTextFieldCell and it all works just fine, but when I try to bind to a buttoncell it says it's not KV compliant for "value" or for "title" - the docs indicate that the "value" is the state, so that would explain that not working, and the other one, "title" is read only.

So I thought I would need to subclass NSButtonCell and expose a new binding, and that there must be some magic to pick that up when binding the column, but that still doesn't work, so I thought I would have to subclass NSTableColumn and expose the binding there, but I'm not sure how that should link to the cell (if I am indeed doing the right thing).

I know I can get a button cell with the right title by using tableview delegate methods, but it doesn't pick up the changes automatically, so I think I need to do it through bindings like this...

Is there an example somewhere that will let me know how to get a buttonCell into a tableview such that it can be bound and update its title dynamically? Any pointers?

Thanks

Gideon_______________________________________________

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: Binding to title of NSButtonCell in a table view
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: Add Tick Mark in NSCombobox List
  • Next by Date: Re: Binding to title of NSButtonCell in a table view
  • Previous by thread: Combining two editable values into one table column
  • Next by thread: Re: Binding to title of NSButtonCell in a table view
  • Index(es):
    • Date
    • Thread