【发布时间】:2011-02-02 07:00:54
【问题描述】:
UIButton 最终继承自 NSObject,NSObject 实现了 NSKeyValueBindingCreation 协议。那么为什么我不能将 UIButton 的属性绑定到另一个类的属性呢?
[myUIButton bind:@"enabled"
toObject:myOtherObject
withKeyPath:@"otherObjectBOOLProperty"
options:nil];
这会导致警告
'UIButton' 可能不响应'-bind:toObject:withKeyPath:options:'
我要做的是将 UIButton 的启用状态绑定到 myOtherObject.otherObjectBOOLProperty。
【问题讨论】:
标签: objective-c ios binding uibutton