CLLocationManager 定位
来源:互联网 发布:java怎么定义一个方法 编辑:程序博客网 时间:2024/06/05 08:39
self.locationManager=[[CLLocationManageralloc]init];
self.locationManager.delegate=self;
[self.locationManagerstartUpdatingLocation];
-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations{
CLLocation *location= [locations objectAtIndex:0];
[self.locationManagerstopUpdatingLocation];
CLGeocoder *geocoder= [[CLGeocoderalloc]init];
//位置反编码
[geocoder reverseGeocodeLocation:locationcompletionHandler:^(NSArray *placemarks,NSError *error) {
CLPlacemark *placemark=[placemarks objectAtIndex:0];
NSLog(@"\n name:%@\n country:%@\n postalCode:%@\n ISOcountryCode:%@\n ocean:%@\n inlandWater:%@\n locality:%@\n subLocality:%@\n administrativeArea:%@\n subAdministrativeArea:%@\n thoroughfare:%@\n subThoroughfare:%@\n",
placemark.name,
placemark.country,
placemark.postalCode,
placemark.ISOcountryCode,
placemark.ocean,
placemark.inlandWater,
placemark.administrativeArea,
placemark.subAdministrativeArea,
placemark.locality,
placemark.subLocality,
placemark.thoroughfare,
placemark.subThoroughfare
);
}];
//[self addLocationView:location];
}
打印
name:中国上海市宝山区淞南镇淞南淞良路301号
country:中国
postalCode:(null)
ISOcountryCode:CN
ocean:(null)
inlandWater:(null)
locality:上海市
subLocality:(null)
administrativeArea:(null)
subAdministrativeArea:宝山区
thoroughfare:淞良路
subThoroughfare:301号
- 定位 (CLLocationManager )
- CLLocationManager 定位
- 定位CLLocationManager
- 定位 CLLocationManager
- CLLocationManager用法示例 定位
- ios定位CLLocationManager
- 通过CLLocationManager定位…
- CLLocationManager 位置定位
- ios CLLocationManager定位
- CLLocationManager定位经纬度
- CLLocationManager 位置定位
- CLLocationManager地理定位
- CLLocationManager 定位不精确
- iOS CLLocationManager定位
- CLLocationManager定位服务
- iOS CLLocationManager定位
- 使用CLLocationManager简单定位
- iOS CLLocationManager定位
- 分管团队执行力弱,原因分析
- selenium弹出框、页面跳转处理
- ORM工具Hibernate 4.3发布, 实现JPA 2.1规范
- 判断oracle index 何时需要重建
- POJ 1189 钉子和小球
- CLLocationManager 定位
- 深入理解Linux操作系统守护进程的意义
- C语言数字转化为字符串
- LeetCode--Convert Sorted Array to Binary Search Tree
- android使用ant编译APK
- 什么是响应式Web设计?怎样进行?
- android推送
- MySQL删除表的时候忽略外键约束
- 在mac os 中安装 autoconf and automake