2012-04-13 13 views
2

正しく書かれた国名に基づいてCLRegionまたはCLLocationCoordinate2Dまたは緯度/経度ポイントを抽出するにはどうすればよいですか? CLGeocoderこのように動作します:国名からの座標/地域

CLGeocoder *geoCode = [[CLGeocoder alloc] init]; 
[geoCode geocodeAddressString:@"Singapore" completionHandler:^(NSArray *placemarks,  NSError *error) { 
if (!error) { 
     CLPlacemark *place = [placemarks objectAtIndex:0]; 
NSLog(@"%i,%i", place.//what would i put here); 

} 


    }]; 

アドレスを伝えるCLPlacemarkホールドを何変数?

答えて

3

決して心はそれを考え出した:

CLGeocoder *geoCode = [[CLGeocoder alloc] init]; 
[geoCode geocodeAddressString:@"Singapore" completionHandler:^(NSArray *placemarks, NSError *error) { 
    if (!error) { 
     CLPlacemark *place = [placemarks objectAtIndex:0]; 
     CLLocation *location = place.location; 
     CLLocationCoordinate2D coord = location.coordinate; 
     NSLog(@"%g is latitude and %g is longtitude", coord.latitude, coord.longitude); 

    } 


}]; 
関連する問題