iso 自有 正反编码

来源:互联网 发布:数据库三大范式好处 编辑:程序博客网 时间:2024/04/20 09:01
////  ViewController.m//  GCoder////  Created by lcy on 16/1/14.//  Copyright (c) 2016年 lcy. All rights reserved.//#import "ViewController.h"#import <MapKit/MapKit.h>//地名  ---->  地理信息//正向编码 (地名)//反向编码@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad {    [super viewDidLoad];    // Do any additional setup after loading the view, typically from a nib.    CLGeocoder *coder = [[CLGeocoder alloc] init];    #if 0    //正向    [coder geocodeAddressString:@"深圳大学" completionHandler:^(NSArray *placemarks, NSError *error) {        //CLPlacemark        CLPlacemark *mark = placemarks[0];                //得到位置信息        NSLog(@"%@",mark.location);                NSLog(@"%@",mark.addressDictionary);                //街道信息        NSLog(@"%@",mark.thoroughfare);                NSLog(@"%@",mark.administrativeArea);    }];#endif        //反向    [coder reverseGeocodeLocation:[[CLLocation alloc] initWithLatitude:22.533367 longitude:113.935404] completionHandler:^(NSArray *placemarks, NSError *error) {        CLPlacemark *mark = placemarks[0];        //街道信息        NSLog(@"%@",mark.thoroughfare);                NSLog(@"%@",mark.subThoroughfare);    NSLog(@"%@",mark.addressDictionary[@"FormattedAddressLines"][0]);    }];}- (void)didReceiveMemoryWarning {    [super didReceiveMemoryWarning];    // Dispose of any resources that can be recreated.}@end

0 0
原创粉丝点击