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

Custom NSActionCell subclass + table column binding


  • Subject: Custom NSActionCell subclass + table column binding
  • From: Stamenkovic Florijan <email@hidden>
  • Date: Thu, 10 Sep 2009 09:07:59 -0400

Hi all,

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.

2) Using the mouse tracking approach that I copied from:
http://code.google.com/p/fskit/source/browse/trunk/FSKit/Sample Apps/FSSearchDemo/SFHFRatingCell.m?r=37

This didn't work either (it also sets the objectValue of the cell)...

I guess I am missing something fairly obvious, but I've been searching through the docs for it, and I can't find it. Any help would be greatly appreciated...

In IB I bound the table column to the arrangedObjects.priority of the array controller of the table. I have a coordinating controller that initializes and sets the custom cell on the column in it's awakeFromNib.

Reading the binding reference for NSTableColumn seems to indicate to me that the cell's objectValue is what gets bound to the managed object's property, so it seems what I am doing should just work, and it just does not.

TIA,
F


_______________________________________________

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: Custom NSActionCell subclass + table column binding
      • From: BareFeet <email@hidden>
  • Prev by Date: Re: [iPhone] How to sense the duration of touch on iPhone button.
  • Next by Date: Re: Custom NSActionCell subclass + table column binding
  • Previous by thread: Re: [iPhone] How to sense the duration of touch on iPhone button.
  • Next by thread: Re: Custom NSActionCell subclass + table column binding
  • Index(es):
    • Date
    • Thread