Hi,

This seems like an elementary question.

I’d like to bind an NSTextField to an array of numerical values, so that the 
text field will either display a single value if the values are identical or 
will display a multiple values marker if the values are different.

Using Swift, I can bind a text field to a single value like this:

dynamic var value = NSNumber(value: 7)

But if I try to bind to an array of values like this:

dynamic var values = [NSNumber(value: 7), NSNumber(value: 3)]

I get the following error:

Cannot create number from object (
    7,
    3
) of class _TtGCs23_ContiguousArrayStorageCSo8NSNumber_

How do I bind an NSTextField to an array?

Jeremy


_______________________________________________

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