更新时间:2023-02-12 09:27:51
绑定值不会更改由Apple的设计。要在更改后自己将值传播给模型,请修改此代码:
The bound value doesn't change by Apple's design. To propagate the value to the model yourself after a change, adapt this code:
NSDictionary *bindingInfo = [self infoForBinding:NSValueBinding];
[[bindingInfo valueForKey:NSObservedObjectKey] setValue:self.doubleValue
forKeyPath:[bindingInfo valueForKey:NSObservedKeyPathKey]];
(感谢@DrummerB的苹果链接!)
(Thanks @DrummerB for that Apple link!)