2012-08-23 45 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。甚至有示例代碼。它可能有助於你正在尋找的東西。

相關問題