• 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 NSButtonCell and NSTableColumn binding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Custom NSButtonCell and NSTableColumn binding


  • Subject: Custom NSButtonCell and NSTableColumn binding
  • From: Alexander Lamb <email@hidden>
  • Date: Fri, 18 Aug 2006 12:15:35 +0200

Hello list,

I searched the list and other sites. Many people seem to have the same question but none found the answer. So here it goes:

I have a custome NSButtonCell: an LSColorCheckCell which in addition to having a state ,has a color (checkColor).

I made the cell key-value-coding compliant by implementing the setCheckColor and checkColor accessor methods.

I havn't made a palette yet but in IB I set my column of the NSTableView to a NSButtonCell then choose LSColorCheckCell as the custom cell class.

after loading the nib, I programmatically set the binding between my controller and my NSTableColumn:

[myTableColumn bind:@"checkColor" toObject:myController withKeyPath:@"arrangedObjects.color" options:nil];

Unfortunately, I get the following runtime error:

[Session started at 2006-08-18 12:08:55 +0200.]
2006-08-18 12:09:01.443 PeopleTasks[18281] Exception raised during posting of notification. Ignored. exception: [<LSColorCheckTableColumn 0x360040> valueForUndefinedKey:]: this class is not key value coding-compliant for the key checkColor.
2006-08-18 12:09:01.531 PeopleTasks[18281] *** NSRunLoop ignoring exception '[<LSColorCheckTableColumn 0x360040> valueForUndefinedKey:]: this class is not key value coding-compliant for the key checkColor.' that raised during posting of delayed perform with target 16252a0 and selector 'invokeWithTarget:'


Now this seems logical since it is my cell which is key-value-coding for checkColor, not my table view. Do I need to create a subclass of NSTableView with setCheckColor? if so, what object do I forward the call since obviously it is not the table column keeping the color?

Thanks,

Alex
--
Alexander Lamb
email@hidden



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Custom NSButtonCell and NSTableColumn binding
      • From: Alexander Lamb <email@hidden>
  • Prev by Date: NSButtonCell and text color?
  • Next by Date: Re: [self init] vs. [super init] in initWithCoder
  • Previous by thread: NSButtonCell and text color?
  • Next by thread: Re: Custom NSButtonCell and NSTableColumn binding
  • Index(es):
    • Date
    • Thread