Skip to main content

Posts

Showing posts with the label mapview

MapView and dealloc IOS

Hello i have a mapView and i think it takes too much memory after leaving the mapView here are my methods is anything missing? - (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]; } The