The analyzer reports that the following code has a potential memory leak. Can someone shed some light on this? I am releasing an annotation that has been highlighted.
-(AddressAnnotation *)addAdress:(NSString*)placeTitle SubTitle:(NSString*)placeSubTitle Coordinate:(CLLocationCoordinate2D)coord withId:(NSInteger) placeId{ AddressAnnotation *annotation = [[AddressAnnotation alloc] initWithCoordinate:coord]; annotation.placeTitle = placeTitle; annotation.placeSubTitle = placeSubTitle; annotation.museumId = placeId; [mapView addAnnotation:annotation]; return annotation; [annotation release]; }
source share