gpt4 book ai didi

objective-c - Objective-C :Object Deallocated while key value observers were still registered with it

转载 作者:IT王子 更新时间:2023-10-29 08:14:14 25 4
gpt4 key购买 nike

我在核心数据模型中添加了 2 个附加字段后遇到了以下错误。

CarPark_CarPark_ was deallocated while key value observers were still registered with it. Observation info was leaked, and may even become mistakenly attached to some other object. 
Set a breakpoint on NSKVODeallocateBreak to stop here in the debugger.
Here's the current observation info:
<NSKeyValueObservationInfo 0x1b6510> (
<NSKeyValueObservance 0x19b210: Observer: 0x1a8cf0, Key path: coordinate,
Options: <New: NO, Old: NO, Prior: YES> Context: 0x0, Property: 0x1b7e00>
)

我有点不知道下一步该做什么。对此的任何指导将不胜感激!请让我知道还需要哪些其他信息。

最佳答案

要设置断点,请打开 Xcode 4 中的断点选项卡(Xcode 3 中的断点窗口)并为符号“NSKVODeallocateBreak”添加一个新的符号断点

使用调试器控制台在观察信息中给定的地址打印观察者

观察者:0x19af20

po 0x19af20

这应该提供有关观察者的一些有值(value)的信息。在您的自定义 CarPark 类中覆盖 addObserver:forKeyPath:options:context: 并设置断点以查看正在建立的观察的确切位置。

关于objective-c - Objective-C :Object Deallocated while key value observers were still registered with it,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5982620/

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