今天我得到了一個錯誤的解釋:)只有一個問題:我不明白它:(所以當我得到這個錯誤時我做錯了什麼?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的委託)觀察?爲什麼它的行爲如果我禁用拖動?
希望有人可以幫助我,並回答以下問題:)
您是否啓用拖動註釋? – nverinaud