I have a map view that shows the users current location and I want to have it show several annotations. I know how to add them individually but I'm thinking I can use an array to store the coordinates and use that array to create the annotations but I'm not sure how to store them in the array and use that array to create all of the annotations. Can anyone help?
Here is how I'm doing it now.
Here is how I'm doing it now.
Code:
- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation
{
CLLocationCoordinate2D loc = [userLocation coordinate];
MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance(loc, 700000, 700000);
[worldView setRegion:region animated:YES];
[locationManager stopUpdatingLocation];
locationManager.delegate = nil;
MKPointAnnotation *point = [[MKPointAnnotation alloc] init];
point.coordinate = CLLocationCoordinate2DMake(37.7867266, -87.608209);
point.title = @"Cates Farm";
point.subtitle = @"Hwy 425 Henderson, KY 42420";
[worldView addAnnotation:point];
MKPointAnnotation *point1 = [[MKPointAnnotation alloc] init];
point1.coordinate = CLLocationCoordinate2DMake(37.0703517, -88.1237899);
point1.title = @"Broadbent B & B Foods";
point1.subtitle = @"257 Mary Blue Road Kuttawa, KY 42055";
[worldView addAnnotation:point1];
}