• 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: Custom NSActionCell subclass + table column binding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom NSActionCell subclass + table column binding


  • Subject: Re: Custom NSActionCell subclass + table column binding
  • From: BareFeet <email@hidden>
  • Date: Thu, 10 Sep 2009 23:40:27 +1000

Hi Florijan,

I've made an NSActionCell subclass for indicating the priority of an object, similar to the rating column in iTunes. The visual aspects of it are working fine, as well as displaying the correct priority for table rows that have a priority value set.

The problem is setting the new priority when the user clicks on the column. I've tried two approaches:

1) Setting the target of the cell to self, and in the action message set the objectValue of the cell to the desired priority (which I have no problem determining from the location of the mouse click). Somehow that does not affect the bound NSManagedObject at all.

If I understand you correctly, you have bound your table column to an array controller, and are trying to change the data by changing the table column. As far as I understand bindings (which isn't much), you aren't supposed to (because it won't work) change the data by programmatically adjusting the view (ie the table column cell).


You should instead direct any programmatic changes to the data itself, through the controller in a key-value compliant way. Then the view will automatically reflect those changes.

I hope this helps. If ou need more detail, I'll try to follow up.

Tom
BareFeet

_______________________________________________

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:
    • [SOLVED] Re: Custom NSActionCell subclass + table column binding
      • From: Stamenkovic Florijan <email@hidden>
References: 
 >Custom NSActionCell subclass + table column binding (From: Stamenkovic Florijan <email@hidden>)

  • Prev by Date: Custom NSActionCell subclass + table column binding
  • Next by Date: Scrolling NSScrollView by fractional amounts - why would values get rounded?
  • Previous by thread: Custom NSActionCell subclass + table column binding
  • Next by thread: [SOLVED] Re: Custom NSActionCell subclass + table column binding
  • Index(es):
    • Date
    • Thread