2010-06-07 31 views

回答

2

上有幾個developer.apple代碼樣本.COM

This

是兩個引腳

+0

我有一個示例代碼,但它無法理解一個簡單的地圖例子。 – 2010-06-07 13:33:23

+1

只需使用所有MKAnnotationView的數組在所有MKMapView上調用addAnnotations即可。 如果您想放置動畫,請將animatesDrop設置爲true – lukya 2010-06-07 13:48:36

0

正如你展示單針..保持單針代碼在環路和環路傳遞不同的經緯度。你會在不同的位置獲得銷

0
if([points retainCount] > 0) 
{ 
    [points release]; 
    points = nil; 


} 


if([annotationAry retainCount] > 0) 
{ 
    [annotationAry release]; 
    annotationAry = nil; 


} 
points = [[NSMutableArray alloc]init]; 
annotationAry = [[NSMutableArray alloc]init]; 
for(int i=0;i<[longitudeary count];i++) 
{ 
    CLLocation* currentLocation1 = [[CLLocation alloc] initWithLatitude:[[latitudeary objectAtIndex:i]doubleValue] longitude:[[longitudeary objectAtIndex:i]doubleValue]]; 

    [points addObject:currentLocation1]; 
} 


for(int i=0;i<[points count];i++) 
{ 



    // CREATE THE ANNOTATIONS AND ADD THEM TO THE MAP 
    CSMapAnnotation* annotation = nil; 

    // create the start annotation and add it to the array 
     annotation = [[[CSMapAnnotation alloc] initWithCoordinate:[[points objectAtIndex:i] coordinate] 
              annotationType:CSMapAnnotationTypeImage 
                 title:@"123456..." 
                 shID:[shIDary objectAtIndex:i] 
                 catID:[catIDary objectAtIndex:i] 
                ciggUse:[ciggaretteUSEary objectAtIndex:i] 
                wifiUse:[wifiUSEary objectAtIndex:i] 
               controller:self]autorelease]; 


    [annotationAry addObject:annotation]; 

} 

[mapViewmy addAnnotations:[NSArray arrayWithArray:annotationAry]]; 
相關問題