Hi guys,
I am creating annotation bubble buttons with the following code:
-(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation
{
if ([annotation isKindOfClass:[MKUserLocation class]])
return nil;
MKPinAnnotationView *view = [mapView dequeueReusableAnnotationViewWithIdentifier:@"ParkPlaceMark"];
if(!view)
{
view=[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"ParkPlaceMark"];
}
UIButton* rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
[rightButton addTarget:self action:@selector(ShowDetails:)forControlEvents:UIControlEventTouchUpInside];
view.rightCalloutAccessoryView = rightButton;
[view setCanShowCallout:YES];
return [view autorelease];
}
How do i get that which annotation is clicked so that i go to details screen with the id and fetch the database record based on that id to show info.
Please help.