2013-04-16 47 views

回答

1

你可以得到信息,如波紋管,其代表方法..

UPDATE:

首先在.h文件中像波紋管這個變量..

NSString *postcode,*locationName; 

並在波紋管方法中使用它...

- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { 
    CLGeocoder * geoCoder = [[CLGeocoder alloc] init]; 
    [geoCoder reverseGeocodeLocation:newLocation completionHandler:^(NSArray *placemarks, NSError *error) { 
     for (CLPlacemark * placemark in placemarks) { 
      postcode = [placemark postalCode]; 
      [postcode retain]; 
      locationName = [placemark name]; 
      [locationName retain]; 

      NSLog(@"\n placemark %@",placemarks); 
     }  
    }]; 
    [geoCoder release]; 
    NSLog(@"\n Location Name ==> %@ ----> GotPostCode:%@",locationName,postcode); 
} 

在這裏你還可以使用CLGeocoder其他財產一樣localitylocation等..

0

CLPlacemark對象存儲給定緯度和經度的地標數據。地標數據包括諸如與指定座標關聯的國家,州,城市和街道地址等信息。

Check Link