2012-08-23 53 views
0

我正在使用以下代码,并且它在地图视图上仅显示一个引脚(注释)。请帮我弄清楚我的错误。为什么只有一个视图引脚注释显示?

- (void)mapView:(MKMapView *)mapView didAddAnnotationViews:(NSArray *)views 
    { 
     //Here 

     NSLog(@"didAddAnnotationViews"); 

     [self.mapView selectAnnotation:[[self.mapView annotations] objectAtIndex:0] animated:NO]; 
     [self.mapView selectAnnotation:[[self.mapView annotations] objectAtIndex:1] animated:NO]; 
     [self.mapView selectAnnotation:[[self.mapView annotations] objectAtIndex:2] animated:NO]; 
     [self.mapView selectAnnotation:[[self.mapView annotations] objectAtIndex:3] animated:NO]; 

      } 

为什么只有一个视图引脚注释显示?

回答

0

请访问Multiple annotation callouts in MKMapView:多个注释标注中的MKMapView

显示看样子,你将不得不实现自定义标注为这种行为。我个人喜欢实现MKAnnotationView的子类来实现一个自定义的。

+0

我的意思是标注... ^^如何同时显示多个标注! http://oi52.tinypic.com/14t3t09.jpg – user1547227

+0

看到我编辑的答案...它可能会帮助你.. – Nit

0

看看这个sample。甚至有示例代码。它可能有助于你正在寻找的东西。

相关问题