Win*_*hen 1 iphone objective-c
当我点击Xcode中Build菜单上的"build and analyze"按钮时,我偶然发现了一个问题.分析建议我发布一个我希望以后返回的变量.代码如下:
- (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;
}
Run Code Online (Sandbox Code Playgroud)
我可以释放annView并返回它而不会造成任何问题吗?