I have a search bar with allows me to fetch Location, Latitude and Longitude. When i get the values, the map shows the annotation perfectly.
Problem : When i select another location, lat, long previous data remains there.
What i need : I want to remove that previous particular location when ever i click the search button.
Code :
double searchLAT = [_searchedLat doubleValue];
double searchLONG = [_searchedLong doubleValue];
MKUserLocation *userlocation = [[MKUserLocation alloc] init];
userlocation.coordinate = CLLocationCoordinate2DMake(searchLAT, searchLONG);
MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance(userlocation.coordinate, 700000, 700000);
[self.mapView setRegion:[self.mapView regionThatFits:region] animated:YES];
MKPointAnnotation *point = [[MKPointAnnotation alloc] init];
point.coordinate = CLLocationCoordinate2DMake(searchLAT,searchLONG);
[self.mapView addAnnotation:point];