开发者

Retrieving the information in the `change` dictionary from KVO

The method

- (void)observeValueForKeyPath:(NSString *)ke开发者_Python百科yPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
}

has a parameter change which is a dictionary that contains information about the nature of the value change, how would I find out what was in this dictionary?


Here's a list of the keys used by the change dictionary.

An extract:

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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜