Pass data to detailView when annotation tapped on mapview

前端 未结 3 516
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-06 08:56

I have a map view and there are 10 store locations which data comes via webservice. I just want to push to my detail view to show address, telephone and other informations o

3条回答
  •  时光取名叫无心
    2021-01-06 09:35

    for(int i=0; i<[arrLat count];i++) {
    
    CLLocationCoordinate2D theCoordinate1; 
    konumpin* myAnnotation1=[[konumpin alloc] init]; 
    
    theCoordinate1.latitude = [[arrLong objectAtIndex:i] doubleValue]; 
    
    theCoordinate1.longitude = [[arrLat objectAtIndex:i] doubleValue]; 
    
    myAnnotation1.coordinate=theCoordinate1; 
    myAnnotation1.title=[arrMagaza objectAtIndex:i]; 
    [annotations addObject:myAnnotation1]; 
    
    } 
    
    [mtMap addAnnotations:annotations];
    

提交回复
热议问题