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!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…