从不兼容的类型id_nullable

时间:2016-08-07 06:34:28

标签: ios objective-c mapkit

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];

1 个答案:

答案 0 :(得分: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;