2016-08-07 1 views
1
NSString* lat,*longi; 
lat= [[deliveryInfo objectAtIndex:0]valueForKey:@"latitude"]; 

NSLog(@"LATITUDE %@",lat); longi= [[deliveryInfo objectAtIndex:0]valueForKey:@"longitude"]; 

c.latitude=[[deliveryInfo objectAtIndex:0]valueForKey:@"latitude"]; 

c.longitude=-74.0565298; sp.latitudeDelta=0.01f; sp.longitudeDelta=0.01f; 

re.center=c; re.span=sp; mapView.region=re; MKPointAnnotation *p=[[MKPointAnnotation alloc]init]; 

p.coordinate=c; [p setTitle:@"USA"]; 

[p setSubtitle:@"Location"]; [mapView addAnnotation:p]; 
+0

유 시도 [있는 NSString stringWithFormat을 ". % 0F"@ c.latitude] = [deliveryInfo objectAtIndex : 0] valueForKey @ "위도"] – ChenSmile

+0

MKCoordinateRegion 다시; MKCoordinateSpan sp; CLLocationCoordinate2D c; – lj999

+0

U는 완전한 방법 코드를 게시 할 수 있습니다 – ChenSmile

답변

2
c.latitude=[[[deliveryInfo objectAtIndex:0]valueForKey:@"latitude"] floatValue]; c.longitude=[[[deliveryInfo objectAtIndex:0]valueForKey:@"longitude"]floatValue]; 
sp.latitudeDelta=0.01f; 
    sp.longitudeDelta=0.01f; 
    re.center=c; 
    re.span=sp; 
    mapView.region=re; 
관련 문제