Binding NSTokenField to an array controller

I have an array controller and a token field for data input.
I cannot find a way to use the marker field to bind tokenized text to an array controller.

The problem is that I use delegation of the token field, returning an NSArrayentity attribute with a format instead of the attribute NSString, and when I run my application, if I use this token field, I have an error that shows me an incompatible data mode (the attribute accepts NSStringinstead NSArray).

In fact, I can process the token field to show me the token parameters, but I cannot process the binding of the token field in the data array!

What can I do to solve this problem?

+3
source share
1 answer

I know that this is old, but I believe that I have an answer and I would like to contribute, because the bindings for the token token field are not documented. In fact, Apple's documentation is misleading.

If all you need is an array of strings stored in the main data and not dealing with field representedObjector token delegates , you can do everything in XIB and xcdatamodel.

The first step is to switch the NSString attribute of the main information object to an attribute that you can bind to the token field. You must make the attribute a transformable type. Name him tokenStringArray. You have finished working with the data model. (And any code that accesses this attribute should now expect an array of strings.)

, , , . , , selection tokenStringArray . " " , , .

. tokenStringArray , , .

[ , , . , , - , . , , . arrangedObjects - .]

+1