Si creo un ViewController con una vista de mapa y este es el único código agrego a viewDidLoad:error posible en MKMapView
MKPointAnnotation* annotation = [[MKPointAnnotation alloc] init];
annotation.coordinate = CLLocationCoordinate2DMake(-90, -180);
[self.mapView addAnnotation:annotation];
[self.mapView removeAnnotation:annotation];
[annotation release];
me sale el error:
An instance 0xa126fa0 of class MKPointAnnotation 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 0xa127df0> (
<NSKeyValueObservance 0xa127c90: Observer: 0xa11c530, Key path: coordinate, Options: <New: NO, Old: NO, Prior: YES> Context: 0x0, Property: 0xa127640>
Si cambio la código para esto, entonces no consigo ningún error:
MKPointAnnotation* annotation = [[MKPointAnnotation alloc] init];
annotation.coordinate = CLLocationCoordinate2DMake(0, 0);
[self.mapView addAnnotation:annotation];
[self.mapView removeAnnotation:annotation];
[annotation release];
la única diferencia es que (0,0) es visible en el mapa, donde una s, (-90, -180) está fuera de la vista. Es decir, necesito desplazarme por el mapa para ver las coordenadas (-90, -180).
¿Alguien ha experimentado este error antes o incluso mejor sabe cómo solucionarlo?
No es un error, es una característica! :) – elp
Me parece un error. Mi corazonada es que cuando está visible, el mapa la retiene por un tiempo más largo (¿para hacer un fundido de salida animado?), Ocultando el error. –
@paska si es una característica es realmente molesta :) –