Re: Custom NSActionCell subclass + table column binding
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