I stumbled into a problem when I hit the "build and analyze" button on the Build menu in my Xcode. The analysis suggest me to release a variable that I wish later on to be returned. The code is like following:
- (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation{
//I do some other thing here
MKPinAnnotationView *annView=
[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"addressLocation"];
//I do some other thing here
return annView;
}
I can I release annView and return it without causing any problem?