I suspect that this is not the whole code involving the addAnnotation
variable. Most likely [mapView removeAnnotation:addAnnotation];
, which releases addAnnotation
, already makes the reference count drop to zero. Do you have something like this in your code somewhere ?
[mapView addAnnotation:addAnnotation];
[addAnnotation release];
If so, then you have transfered the complete ownership of addAnnotation to the mapView and you don't need to release it in showAddress
any more, which means that removeAnnotation:
is enough.
DarkDust
2010-10-10 09:54:44