Home > front end >  Where exactly is value of NSTokenField applied when using Binding?
Where exactly is value of NSTokenField applied when using Binding?

Time:03-23

I'm currently using an NSTokenField with a binding of its value to an NSArrayController keypath configured in IB. This works all well.

Now I'm having difficulties adjusting the initial size of the NSTokenField to the initial data it's being populated with by the NSArrayController - I'm missing a hook to react to the value being set. According to Apple's Binding Guide explaining the inner workings of a binding with the example of an NSTextField (the base class for NSTokenField) it should be setObjectValue: that is invoked at some point to fill the NSTokenField with data. Most interestingly this method is never called. So to find my out where else the token field gets its data from the array controller, I tried the following:

- (void)setObjectValue:(id)objectValue {
    [super setObjectValue:objectValue];
    NSLog(@"           
  • Related