我想监视按钮单元格突出显示状态,但回调永远不会调用,尽管突出显示会更改
监控keyPath“状态”有效,但为什么不监控突出显示?
- (void)awakeFromNib {
[super awakeFromNib];
[self.cell addObserver:self
forKeyPath:@"highlighted"
options:(NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld)
context:NULL];
}
- (void)observeValueForKeyPath:(NSString *)keyPath
ofObject:(id)object
change:(NSDictionary *)change
context:(void *)context
{
...
}