GMSReverseGeocodeResponse
含む
- (GMSReverseGeocodeResult *)firstResult;
その定義は次のようなものです:
@interface GMSReverseGeocodeResult : NSObject<NSCopying>
/** Returns the first line of the address. */
- (NSString *)addressLine1;
/** Returns the second line of the address. */
- (NSString *)addressLine2;
@end
これら2つの文字列から国、ISO国コード、州(administrative_area_1または対応するもの)を取得する方法はありますか(すべての国とすべての住所に有効)?
注:このコードを実行しようとしました
[[GMSGeocoder geocoder] reverseGeocodeCoordinate:CLLocationCoordinate2DMake(40.4375, -3.6818) completionHandler:^(GMSReverseGeocodeResponse *resp, NSError *error)
{
NSLog( @"Error is %@", error) ;
NSLog( @"%@" , resp.firstResult.addressLine1 ) ;
NSLog( @"%@" , resp.firstResult.addressLine2 ) ;
} ] ;
しかし、何らかの理由でハンドラーが呼び出されませんでした。アプリキーを追加し、iOS バンドル ID もアプリキーに追加しました。コンソールにエラーは出力されません。これは、行の内容を認識していないことを意味します。