Setting breakpoint at NSKVODeallocateBreak

走远了吗. 提交于 2019-11-29 02:01:39

You are probably doing something like this in your code:

[addressAnnotation addObserver:self forKeyPath:kSelectedAnnotationObserverKeyPath options:NSKeyValueObservingOptionNew context:@"selectedOrDeselected"];

That means that you are registering an observer to find out when an annotation has been selected.

You should remove the observer when the annotation gets removed from the map, like this:

[addressAnnotation removeObserver:self forKeyPath:kSelectedAnnotationObserverKeyPath];

That should remove the error. If it doesn't and you want to debug it, you certainly should set a breakpoint on NSKVODeallocateBreak. In order to do this, open the Run menu, Manage Breakpoints, Add symbolic breakpoint, enter NSKVODeallocateBreak and there you are.

Hope it helps!

To set a breakpoint here with LLDB, start your app, then pause it, and at the LLDB debug prompt write:

breakpoint set --name NSKVODeallocateBreak

Now you've got a breakpoint set there. Hopefully this should help you find the problem, which probably will be of the kind described by @frowing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!