0

I have multi pin on my map (about restaurants, hotels etc..), on that pins I have an "arrow" (rightcalloutaccessoryview). The coordinates are stored on the sqlite database.

I can get the coordinates and the right id when I click on the pin then I'm checking on the DB where are that coordinates.

Objective: When I click on the a hotel pin I want to go to that detail ViewController (that loads with the id of that hotel)

Any ideias?

4

1 回答 1

1

是的,试试下面的示例代码。在这里,我曾经用它们的标题来区分注释(pin)。并使用地图视图委托方法

- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view
   calloutAccessoryControlTapped:(UIControl *)control
{
    NSLog(@"accessory button tapped for annotation %@", [view.annotation title]);

    if([[view.annotation title] isEqualToString:@"one"])
    { 
           // Push to another view controller code here
    }
}

 

于 2013-06-19T14:38:23.167 回答