views:

180

answers:

1

I'm attempting to bind an NSColorWell to the NSTextField value and implementing an NSFormatter subclass. The NSColorWell is bound to an ivar in the app delegate which is also bound to the NSTextField. There is an NSFormatter that converts the [NSColorWell color] to a descriptive string.

When the UI focus is on the NSTextField, it doesn't update at all; but when the focus is on another NSTextField, it does.

I understand KVO/KVC, bindings etc. but wonder if there are any 'gotchas' in IB that I'm missing.

+2  A: 

Try a bidirectional value transformer instead. For one advantage, you may find it easier to implement than a formatter.

Peter Hosey
very helpful ... the implementation methods of the NSValueTransformer class are much more straightforward than those of the NSFormatter; and it works perfectly.
alan