gpt4 book ai didi

objective-c - 从KVO中检索 `change`字典中的信息

转载 作者:行者123 更新时间:2023-12-03 16:24:32 25 4
gpt4 key购买 nike

方法

- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
}

有一个参数change,它是一个字典,其中包含有关值更改性质的信息,我如何找出该字典中的内容?

最佳答案

这是 keys used by the change dictionary 的列表.

摘录:

Keys used by the change dictionary

These constants are used as keys in the change dictionary passed to observeValueForKeyPath:ofObject:change:context:.

NSString *const NSKeyValueChangeKindKey;
NSString *const NSKeyValueChangeNewKey;
NSString *const NSKeyValueChangeOldKey;
NSString *const NSKeyValueChangeIndexesKey;
NSString *const NSKeyValueChangeNotificationIsPriorKey;

关于objective-c - 从KVO中检索 `change`字典中的信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1625800/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com