今天我得到了一个错误的解释:) 只有一个问题:我不明白:(那么当我得到这个错误时我做错了什么?
2012-04-30 03:04:35.737 Barz[21961:11903] An instance 0x7491960 of class BarAnnotation 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 0x74a18b0> (
<NSKeyValueObservance 0x74a1700: Observer: 0x747f2b0, Key path: coordinate, Options: <New: NO, Old: NO, Prior: YES> Context: 0x0, Property: 0x74a11c0>
)
不是我没有手动添加任何观察者,我只是在 viewWillAppear 方法中删除“BarAnnotation”(我的自定义 MKAnnotation)并将其添加到我的 mapView? 我也不太确定我是否了解谁在观察谁:我的 mapView 是否在观察所有 MKAnnotations?还是我的 mapViewController(== mapView 的委托(delegate))在观察?如果我禁用拖动,为什么它会这样?
希望有人能帮助我并回答其中的一些问题:)
最佳答案
我已经看到当注释的坐标无效时会发生这种情况。你检查过了吗?
关于ios - MapView、MKAnnotation 和 Key-Value-Observing - 错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10377508/