2012-04-30 12 views
5

oggi ho ricevuto un errore con una spiegazione :) C'è solo un problema: non lo capisco :(Quindi cosa sto facendo male quando ottengo questo errore?MapView, MKAnnotation & Key-Value-Observing - Messaggio di errore

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> 
    ) 
non

che non ho aggiunto manualmente qualsiasi osservatore, ho solo rimuovere e aggiungere "BarAnnotation" (mia abitudine MKAnnotation) al mio MapView nel metodo viewWillAppear? io non sono molto sicuro anche se ho capito che sta osservando chi: la mia mapView osserva tutte le MKAnnotations o il mio mapViewController (== mapView's delegate) sta osservando? E perché si comporta in questo modo se ho disabilitato il dragging?

Spero che qualcuno possa aiutarmi e rispondere ad alcune di queste domande :)

+0

Hai abilitato il trascinamento dell'annotazione? – nverinaud

risposta

3

Ho visto accadere quando le coordinate dell'annotazione non sono valide. Hai controllato?

+0

In effetti, un'annotazione con longitudine 'nan' stava causando il crash nel mio caso. – samvermette