Here's a little mystery that maybe someone can help me with…

I have an NSComboBox for numbers (and hence with an NSNumberFormatter attached 
to its text field) for which I'd like to populate some items in the drop down 
list.

I understand that I must present NSDecimalNumber objects for list content and 
I'd prefer to use bindings for this, so I create a simple NSArray of 
NSDecimalNumber values and provide this as the Content binding.  I get a drop 
down list with no visible values.

If I give up and use a DataSource, I can instantiate NSDecimalNumbers in the 
-comboBox:objectValueForItemAtIndex: method and everything works peachy.

Now, I don't know what this means exactly, but I thought I'd implement a value 
transformer in the Content binding, just to take a look at the values flying by 
and maybe assert values of NSDecimalValue type.  What I find is the transformer 
is provided with the _whole_ array to transform, rather than individual value 
elements as I'd expect. 

It's hard not to conclude that NSComboBox with an NSNumberFormatter attached is 
somehow broken for binding, but I'd certainly like to be put right on that 
score.

In the meantime, I have a workaround in the way of a DataSource.  But I'm sad.  
I like binding things.

-- Luke


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to