Iphone 如何在注释引脚上添加ModelView控制器以显示详细的UI视图

Iphone 如何在注释引脚上添加ModelView控制器以显示详细的UI视图,iphone,annotations,presentmodalviewcontroller,Iphone,Annotations,Presentmodalviewcontroller,我想通过在注释针上单击来添加具有两个按钮和三个标签的详细视图。是否有任何教程或示例代码链接。我有搜索,但只得到canShowCallout子标题,这是旧的方式 已编辑:-我已解析URL,然后在成功条件下,我已将此代码放入注释。我应该在MKAnnotation视图中进行哪些更改也告诉我 for (int i = 0; i < [appDelegate.markers count]; i++) { marker *aMarker = [appDelegate.markers ob

我想通过在注释针上单击来添加具有两个按钮和三个标签的详细视图。是否有任何教程或示例代码链接。我有搜索,但只得到canShowCallout子标题,这是旧的方式

已编辑:-我已解析URL,然后在成功条件下,我已将此代码放入注释。我应该在MKAnnotation视图中进行哪些更改也告诉我

   for (int i = 0; i < [appDelegate.markers count]; i++)
{
    marker *aMarker = [appDelegate.markers objectAtIndex:i];
    location.latitude = [aMarker.lat floatValue];
    location.longitude =[aMarker.lng floatValue];
    AddressAnnotation *annobj = [[AddressAnnotation alloc]   initWithCoordinate:location];
    //[annobj setAnnotationType:AddressAnnotationTypeHettich];
    //annobj.title = aMarker.name;
    //annobj.subTitle = aMarker.address;
    [mapView addAnnotation:annobj];
    [annobj release];

            CLLocationCoordinate2D ausLoc = {location.latitude,location.longitude};                            
            //for zoom in the showroom results region
    MKCoordinateSpan ausSpan = MKCoordinateSpanMake(0.108889, 0.169922);
    MKCoordinateRegion ausRegion = MKCoordinateRegionMake(ausLoc, ausSpan);
    NSLog(@"No Errors");
    mapView.region = ausRegion;



}

请参考任何人是否可以为presentModelview控制器提供示例代码。是否将所有注释放在nsmutablearray中?将所有注释对象添加到nsmutablearray mapAnnonations中,如[mapAnnonations insertObject:mapAnnotation atIndex:i];[mymapView添加注释:mapAnnonations];参考我上面的链接,你能粘贴一些包含上述解决方案的代码吗。我收到错误我收到NSArray无法识别的选择器发送到实例,同时遵循上述方法。我更新有问题的代码时出错。你能检查一下这个吗???
        indexRow = 0;
        mapAnnonations = [[[NSMutableArray alloc] init] retain];
        for (int i = indexRow; i<[lat ,longi count]; i++)
        {
            region.center.latitude = [[lat objectAtIndex:indexRow] floatValue];
            region.center.longitude = [[longi objectAtIndex:indexRow] floatValue];
            region.span.longitudeDelta = 0.04f;
            region.span.latitudeDelta = 0.04f;

            [mymapView setRegion:region animated:YES];

            coordinate.latitude = [[lat objectAtIndex:indexRow] floatValue];
            coordinate.longitude = [[longi objectAtIndex:indexRow]floatValue];

            NSLog(@"Latitude & Longitude:---->%f,%f",coordinate.latitude,coordinate.longitude);

            mapAnnotation = [[AllMapAnnotation alloc] initWithCoordinate:coordinate]; 
            NSString *title = [[[resData valueForKey:@"name"] mutableCopy] objectAtIndex:indexRow];
            NSString *titleStr = [title stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
            NSLog(@"Pin Title:--->%@",titleStr);
            [mapAnnotation setTitle:titleStr];

            //[mapAnnotation setSubtitle:[NSString stringWithFormat:@"Ph: %@",pantries.phone]];
            mapAnnotation.coordinate = region.center; 
            [mapAnnonations insertObject:mapAnnotation atIndex:indexRow];
            [mymapView addAnnotations:mapAnnonations];
            //[mymapView addAnnotation:mapAnnotation];
            indexRow+= 1;
        }


-(MKAnnotationView *)mapView:(MKMapView *)mV viewForAnnotation:(id <MKAnnotation>)annotation 
{
    MKPinAnnotationView *pinView = nil; 
    if(annotation!= mymapView.userLocation) 
    {
        static NSString *defaultPinID = @"pantryIdentifier";
        pinView = (MKPinAnnotationView *)[mymapView dequeueReusableAnnotationViewWithIdentifier:defaultPinID];
        if ( pinView == nil ) pinView = [[[MKPinAnnotationView alloc]
                                          initWithAnnotation:annotation reuseIdentifier:defaultPinID] autorelease];

        pinView.pinColor = MKPinAnnotationColorGreen; 
        pinView.canShowCallout = YES;
        pinView.animatesDrop = YES;


        NSInteger annotationValue = [mapAnnonations indexOfObject:annotation];
        NSLog(@"Annotation Value:--->%d",annotationValue);

        rightButton = [UIButton buttonWithType:UIButtonTypeCustom];
        rightButton.frame = CGRectMake(40, 5, 20, 22);

        [rightButton setBackgroundImage:[UIImage imageNamed:@"listtab_arrow.png"] forState:UIControlStateNormal];

        rightButton.tag = annotationValue;      
        [rightButton addTarget:self action:@selector(showDetails:)
                  forControlEvents:UIControlEventTouchUpInside];
        pinView.rightCalloutAccessoryView = rightButton;


    } 
    else 
    {
        [mymapView.userLocation setTitle:@"I am here"];
    }


    return pinView;

}

- (IBAction)showDetails:(UIView *)sender
{
    NSInteger selectedIndex = sender.tag;

    list = [[ListView alloc] initWithNibName:@"ListView" bundle:nil];
    details = [[resData valueForKey:@"reference"] mutableCopy];
    NSLog(@"Reference:--->%@",details);
        list.refernceIndex =  [NSString stringWithFormat:@"%@",[details objectAtIndex:selectedIndex]];

        [appDelegate.navigationController pushViewController:list animated:YES];

}