title: Bind NSTextField's text color to NSColorWell?
body: <p>I'm quite new to Cocoa Bindings, but I've seen enough that I'd love to change all my old clunky methods over to it.  For example, I have a <code>NSColorWell</code> that changes the text color of some <code>NSTextField</code>s in my view. Seems easy in practice, but it's not working.</p>
  
  <p>Here's how my bindings look for my <code>NSColorWell</code>:</p>
  
  <p><img src="https://i.stack.imgur.com/G5RK4.png" alt="enter image description here"></p>
  
  <p>And here's my bindings for my <code>NSTextField</code>:</p>
  
  <p><img src="https://i.stack.imgur.com/AiFX8.png" alt="enter image description here"></p>
  
  <p>But instead of displaying a color it just displays <code>NSCalibratedRGBColor...</code>.  Obviously it's not setting the value of the color to the field, it's just displaying the raw data.  </p>
  
  <p>So, after poking around I tried to make my own <code>NSValueTransformer</code> by doing this:</p>
  
  <pre><code>@interface DataToColor: NSValueTransformer {}
  @end
  #import "QWDataToColor.h"
  @implementation DataToColor
  +(Class)transformedValueClass { return [NSColor class]; }
  +(BOOL)allowsReverseTransformation { return NO; }
  -(id)transformedValue:(id)item {
      NSColor *theColor=nil;
      NSData *theData=[NSData dataWithData:item];
      if (theData != nil)
          theColor=(NSColor *)[NSUnarchiver unarchiveObjectWithData:theData];
      return theColor;
  }
  @end
  </code></pre>
  
  <p>Then I set that value transformer to my "Value Transformer" area in my bindings in IB. </p>
  
  <p>However, it still gave the same results.  Any ideas?</p>