Iphone MapView和dealloc IOS

Iphone MapView和dealloc IOS,iphone,objective-c,memory,android-mapview,dealloc,Iphone,Objective C,Memory,Android Mapview,Dealloc,您好,我有一个mapView,我认为离开mapView后占用了太多内存 这是我的方法,有什么遗漏吗 - (void)viewDidUnload { mapView.showsUserLocation = NO; b [mapView removeAnnotations:mapView.annotations]; [super viewDidUnload]; } -(void)dealloc{ [name release]; [type rele

您好,我有一个mapView,我认为离开mapView后占用了太多内存

这是我的方法,有什么遗漏吗

- (void)viewDidUnload
{

    mapView.showsUserLocation = NO; b
    [mapView removeAnnotations:mapView.annotations]; 

    [super viewDidUnload];

}


-(void)dealloc{
    [name release];
    [type release];
    [address release];
    mapView.delegate = nil;

    [super dealloc];
}

- (void)viewDidLoad{
    foundLocation = location found <----   

    MKCoordinateRegion region;
    region.center.latitude = foundLocation.coordinate.latitude;
    region.center.longitude=foundLocation.coordinate.longitude;
    region.span.longitudeDelta=0.01;
    region.span.latitudeDelta=0.01;
    [mapView setRegion:region animated:NO];

    ann = [[MapAnnotation alloc]init];
    ann.title = name;
    ann.subtitle = type;
    ann.coordinate=region.center;
    [mapView addAnnotation:ann];
    [ann release];

    self.navigationItem.title=@"Map";
    [super viewDidLoad];
}
-(void)viewDidUnload
{
mapView.showsUserLocation=否;b
[mapView removeAnnotations:mapView.annotations];
[超级视频下载];
}
-(无效)解除锁定{
[姓名发布];
[类型发布];
[地址发布];
mapView.delegate=nil;
[super dealoc];
}
-(无效)viewDidLoad{

foundLocation=location found在您将代理设置为零后,您没有调用
[mapView release]

我不理解您最后的评论。对不起,您刚刚救了我一天!非常感谢您摇滚人!!!!!数小时的编码我看不到明显的效果!