ユーザーがピンを選択すると、そのピンの詳細画面に移動するピンを含むマップ ビューがあります。また、ユーザーがアイテムを選択すると、同じタイプの詳細ビューに移動するテーブル ビューもあります。
配列を介してマップビューに複数のピンを追加しています。アクセサリービューにボタンを追加しましたが、
ここに問題があります...
ピンの選択ボタンをタップすると、別のピンの詳細ビューに移動します。しかし、テーブル ビューではまだ正常に動作します。
-(MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation 
{
    MKPinAnnotationView *newAnnotation = nil;
    if([annotation.title isEqualToString:@"You are here."])
    {
        newAnnotation = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"greenpin"];
        newAnnotation.pinColor = MKPinAnnotationColorGreen;
    }
    else
    {      
        newAnnotation = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"redpin"];
        newAnnotation.pinColor = MKPinAnnotationColorRed;
        UIButton *pinButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
        pinButton.tag = indexvar;
        [newAnnotation addSubview:pinButton];
        newAnnotation.canShowCallout = YES;    
        newAnnotation.rightCalloutAccessoryView = pinButton;
        newAnnotation.calloutOffset = CGPointMake(-5, 5);
        indexvar++;
        return newAnnotation;
        [pinButton release];
    }
    newAnnotation.animatesDrop = YES;
    newAnnotation.canShowCallout = YES;
    return newAnnotation;
}
- (void)mapView:(MKMapView *)wikiMapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control 
{
    NSInteger selectedIndex = ((UIButton *)control).tag;
    NSLog(@"Property Index : %d ",selectedIndex);
    DetailView = [[PropertyDetails alloc] initWithNibName:@"PropertyDetails" bundle:nil];
    DetailView.propertyReference = [PropertyReferenceArr objectAtIndex:selectedIndex];
    DetailView.propertyTitle = [propertyTitlesArr objectAtIndex:selectedIndex];
    DetailView.propertyPrice = [propertyPriceArr objectAtIndex:selectedIndex];
    DetailView.propertyBedrooms = [propertyBedroomsArr objectAtIndex:selectedIndex];
    DetailView.propertyLatitude = [propertyLatitudesArr objectAtIndex:selectedIndex];
    DetailView.propertyLongitude = [propertyLongitudesArr objectAtIndex:selectedIndex];
    DetailView.propertyDefaultImage = [PropertyImageArr objectAtIndex:selectedIndex];
    DetailView.propertyStatusId = [PropertyStatusArr objectAtIndex:selectedIndex];
    [self.navigationController pushViewController:DetailView animated:YES];         
    [DetailView release]; 
}