MapView,MKAnnotation&键值观察 - 错误消息

时间:2012-04-30 01:26:45

标签: ios android-mapview mkannotation key-value-observing

今天我得到了一个错误的解释:)只有一个问题:我不明白:(那么当我收到此错误时,我做错了什么?

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的委托)观察?如果我禁用拖动,为什么它会像那样?

希望有人可以帮助我并回答其中一些问题:)

1 个答案:

答案 0 :(得分:3)

我注意到当注释的坐标无效时会发生这种情况。你检查过了吗?