gpt4 book ai didi

core-data - CoreData addObserver NSKeyValueChangeInsertion

转载 作者:行者123 更新时间:2023-11-29 05:07:13 25 4
gpt4 key购买 nike

有没有办法获取在 NSManagedObject 上使用 addObserver:forKeyPath:options:context: 和选项 NSKeyValueChangeInsertion 添加的对象>?

最佳答案

是的。来自 observeValueForKeyPath:ofObject:change:context: 的文档:

change A dictionary that describes the changes that have been made to the value of the property at the key path keyPath relative to object. Entries are described in “Keys used by the change dictionary.”

再往下:

NSKeyValueChangeKindKey An NSNumber object that contains a value corresponding to one of the NSKeyValueChangeKindKey enumerations, indicating what sort of change has occurred.

NSKeyValueChangeIndexesKey If the value of the NSKeyValueChangeKindKey entry is NSKeyValueChangeInsertion, NSKeyValueChangeRemoval, or NSKeyValueChangeReplacement, the value of this key is an NSIndexSet object that contains the indexes of the inserted, removed, or replaced objects.

关于core-data - CoreData addObserver NSKeyValueChangeInsertion,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4403233/

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