title: Open different websites through pinpoints in mapview
body: <p>My idea is to have several (maybe as much as 100) pinpoints in a Google map. </p>
  
  <p>I have created a button in the annotation message that appears when I click the pin. I want each pinpoint to be connected to a website. A different website for each pinpoint. </p>
  
  <p>But at the moment I use this:</p>
  
  <pre><code>- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view 
      calloutAccessoryControlTapped:(UIControl *)control
  {
      [[UIApplication sharedApplication] 
          openURL:[NSURL URLWithString: @"http://www.google.co.uk"]];
  </code></pre>
  
  <p>The problem is that with this code, all the pinpoints open the same website. </p>
  
  <p>Is there any way I can specify a web address for each pinpoint?</p>
  
  <pre><code>#import "ViewController.h"
  #import "NewClass.h"
  
  @implementation ViewController
  @synthesize mapview;
  
  NSString *myString;
  
  - (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control
  {
      //[[UIApplication sharedApplication] 
       //openURL:[NSURL URLWithString: @"http://www.arebikepark.se"]];
  
     NewClass *ann = (NewClass *)view.annotation;
      [[UIApplication sharedApplication] openURL:[NSURL URLWithString:ann.website]];
  }
  
  -(IBAction)getLocation {
      mapview.showsUserLocation = YES;
  }
  
  -(IBAction)setMap:(id)sender {
      switch (((UISegmentedControl *) sender).selectedSegmentIndex) {
          case 0:
              mapview.mapType = MKMapTypeStandard;
              break;
          case 1:
              mapview.mapType = MKMapTypeSatellite;
              break;
          case 2:
              mapview.mapType = MKMapTypeHybrid;
              break;
  
          default:
              break;
   }
  }
  
  - (void)viewDidLoad {
      [super viewDidLoad];
  
      [mapview setMapType:MKMapTypeStandard];
      [mapview setZoomEnabled:YES];
      [mapview setScrollEnabled:YES];
  
      MKCoordinateRegion region = { {0.0, 0.0 }, {0.0, 0.0 } };
      region.center.latitude = 63.399785761795506;
      region.center.longitude =  12.91691780090332;
      region.span.longitudeDelta = 100.0f;
      region.span.latitudeDelta = 100.0f;
      [mapview setRegion:region animated:YES];
  
      NewClass *ann = [[NewClass alloc] init];
      ann.title = @"Åre";
      ann.subtitle = @"www.arebikepark.se";
      ann.coordinate = region.center;
      ann.website = @"arebikepark.se";
      [mapview addAnnotation:ann];
  
      MKCoordinateRegion region1 = { {0.0, 0.0 }, {0.0, 0.0 } };
      region1.center.latitude = 61.717050948488904;
      region1.center.longitude =  16.153764724731445;
      region1.span.longitudeDelta = 100.0f;
      region1.span.latitudeDelta = 100.0f;
      [mapview setRegion:region1 animated:YES];
  
      NewClass *ann1 = [[NewClass alloc] init];
      ann1.title = @"Järvsö";
      ann1.subtitle = @"www.jarvsobergscykelpark.se";
      ann1.coordinate = region1.center;
      ann.website = @"www.jarvsobergscykelpark.se";
      [mapview addAnnotation:ann1];
  
      MKCoordinateRegion region2 = { {0.0, 0.0 }, {0.0, 0.0 } };
      region2.center.latitude = 57.84191869696362;
      region2.center.longitude =  12.02951431274414;
      region2.span.longitudeDelta = 100.0f;
      region2.span.latitudeDelta = 100.0f;
      [mapview setRegion:region2 animated:YES];
  
      NewClass *ann2 = [[NewClass alloc] init];
      ann2.title = @"Ale";
      ann2.subtitle = @"www.alebikepark.se";
      ann2.coordinate = region2.center;
      [mapview addAnnotation:ann2];
  
      MKCoordinateRegion region3 = { {0.0, 0.0 }, {0.0, 0.0 } };
      region3.center.latitude = 61.17768100166834;
      region3.center.longitude =  13.261871337890625;
      region3.span.longitudeDelta = 100.0f;
      region3.span.latitudeDelta = 100.0f;
      [mapview setRegion:region3 animated:YES];
  
      NewClass *ann3 = [[NewClass alloc] init];
      ann3.title = @"Kläppen";
      ann3.subtitle = @"www.klappen.se/sv/Sommar/Bikepark";
      ann3.coordinate = region3.center;
      ann3.website = @"www.klappen.se/sv/Sommar/Bikepark";
      [mapview addAnnotation:ann3];
  
      MKCoordinateRegion region4 = { {0.0, 0.0 }, {0.0, 0.0 } };
      region4.center.latitude = 65.82881853569008;
      region4.center.longitude =  15.067813396453857;
      region4.span.longitudeDelta = 100.0f;
      region4.span.latitudeDelta = 100.0f;
      [mapview setRegion:region4 animated:YES];
  
      NewClass *ann4 = [[NewClass alloc] init];
      ann4.title = @"Hemavan";
      ann4.subtitle = @"www.bikepark.nu";
      ann4.coordinate = region4.center;
      ann4.website = @"www.bikepark.nu";
      [mapview addAnnotation:ann4];
  
      MKCoordinateRegion region5 = { {0.0, 0.0 }, {0.0, 0.0 } };
      region5.center.latitude = 63.29058608431198;
      region5.center.longitude =  18.7042236328125;
      region5.span.longitudeDelta = 100.0f;
      region5.span.latitudeDelta = 100.0f;
      [mapview setRegion:region5 animated:YES];
  
      NewClass *ann5 = [[NewClass alloc] init];
      ann5.title = @"Örnsköldsvik";
      ann5.subtitle = @"www.hkbikepark.se";
      ann5.coordinate = region5.center;
      ann5.website = @"www.hkbikepark.se";
      [mapview addAnnotation:ann5];
  }
  
  -(MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id &lt;MKAnnotation&gt;)annotation {
      MKPinAnnotationView *MyPin =(MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:@"MyPin"];
      if (!MyPin) {
          MyPin = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"MyPin"];
          MyPin.pinColor = MKPinAnnotationColorRed;
          MyPin.canShowCallout = YES;
          UIButton *details = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
          MyPin.rightCalloutAccessoryView = details;
          MyPin.canShowCallout = YES;
      }
      return MyPin;
  }
  
  @end
  </code></pre>